Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-149

deploy fails if metadata doesn't already exist on the repo

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-alpha-4
    • 1.0-alpha-5
    • wagon-ftp
    • None
    • WinXP

    Description

      If I try to deploy a new project using ftp, it fails trying to retreive the previous metadata. See stack trace below. If I use file as the deploy type first, then everything is ok. I compared the code of the file and ftp wagon and found that the ftp wagon is throwing a TransferFailedException in the case of a missing file. I changed the code to this:
      is = ftp.retrieveFileStream( PathUtils.filename(
      resource.getName() ) );
      //handle missing file
      if ( is == null )

      { throw new ResourceDoesNotExistException( "File: " + resource.getName() + " does not exist" ); }

      And this seems to have solved the problem. I'm not positive if this is the most effective way to fix it, but does solve my problem for now and should give a giant headstart to a correct fix.

      Uploading:
      ftp://sv1/stc-maven-repo/com/stchome/shared/supplementaldata/1.0/supplem
      entaldata-1.0.jar
      2K uploaded
      [INFO] Retrieving previous metadata from STCRepo [INFO]
      ------------------------------------------------------------------------


      [ERROR] BUILD ERROR
      [INFO]
      ------------------------------------------------------------------------


      [INFO] Diagnosis: Error deploying artifact [INFO]
      ------------------------------------------------------------------------


      [DEBUG] Trace:

      org.apache.maven.plugin.MojoExecutionException: Error deploying artifact
      at
      org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:154)
      at
      org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
      nager.java:417)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
      LifecycleExecutor.java:554)

      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
      ycle(DefaultLifecycleExecut
      or.java:508)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
      ifecycleExecutor.java:494)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
      DefaultLifecycleExecutor.ja
      va:307)
      at
      org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
      ycleExecutor.java:149)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:217)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:247)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
      a:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at
      org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at
      org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by:
      org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact:
      at
      org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(Defaul
      tArtifactDeployer.java:95)
      at
      org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(Defaul
      tArtifactDeployer.java:53)
      at
      org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:142)
      ... 16 more
      Caused by:
      org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException:
      Unable to retrieve metadata
      at
      org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataM
      anager.resolveAlways(Defaul
      tRepositoryMetadataManager.java:287)
      at
      org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataM
      anager.deploy(DefaultReposi
      toryMetadataManager.java:311)
      at
      org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(Defaul
      tArtifactDeployer.java:83)
      ... 18 more
      Caused by: org.apache.maven.wagon.TransferFailedException:
      ftp://sv1/stc-maven-repo - Could not open input str eam for resource:
      'org.apache.maven.wagon.resource.Resource@76e8a7'
      at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:76)
      at
      org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(Defa
      ultWagonManager.java:347)
      at
      org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadat
      a(DefaultWagonManager.java:
      276)
      at
      org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataM
      anager.resolveAlways(Defaul
      tRepositoryMetadataManager.java:273)
      ... 20 more
      [INFO]
      ------------------------------------------------------------------------


      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            brettporter Brett Porter
            brianf Brian E Fox
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment