Uploaded image for project: 'Maven Deploy Plugin'
  1. Maven Deploy Plugin
  2. MDEPLOY-87

Exception in deploy-file when uploading artifact with different owner for maven-metadata.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.4
    • None
    • None
    • None

    Description

      We have a case with several persons uploading to an internal repository (for our closed-source dependencies). Each person uses a his own user account for uploading, and a common group for all files. So we have a situation where artifact com.agroup:anartifact was first uploaded in version 2.0 by a user, and when another user tries to upload version 2.5 we get a LifecycleExecutionException with the message "Error while deploying metadata" (full stack trace provided below).

      It seems this happens because the SSH provider tries to chown a file created by a different user. All the files are writable by group, so there should be no need for the chmod. The best work-around we have found so far is that a server administrator has to chown maven-metadata.xml* to the user that will do the upload.

      Stack trace:
      [INFO] Uploading repository metadata for: 'artifact com.agroup:anartifact'
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error installing artifact's metadata: Error while deploying metadata: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external

      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error installing artifact's metadata: Error while deploying metadata: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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.plugin.MojoExecutionException: Error installing artifact's metadata: Error while deploying metadata: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external
      at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:244)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
      ... 16 more
      Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error installing artifact's metadata: Error while deploying metadata: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:102)
      at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:240)
      ... 18 more
      Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataDeploymentException: Error while deploying metadata: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:450)
      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:86)
      ... 19 more
      Caused by: org.apache.maven.wagon.TransferFailedException: Error occured while deploying 'com/agroup/anartifact/maven-metadata.xml' to remote repository: sftp://internalserver/maven2repository/external
      at org.apache.maven.wagon.providers.ssh.jsch.SftpWagon.put(SftpWagon.java:104)
      at org.apache.maven.wagon.providers.ssh.jsch.SftpWagon.put(SftpWagon.java:291)
      at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:244)
      at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifactMetadata(DefaultWagonManager.java:169)
      at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:446)
      ... 20 more
      Caused by: 3: Permission denied
      at com.jcraft.jsch.ChannelSftp.throwStatusError(Unknown Source)
      at com.jcraft.jsch.ChannelSftp._setStat(Unknown Source)
      at com.jcraft.jsch.ChannelSftp.chmod(Unknown Source)
      at org.apache.maven.wagon.providers.ssh.jsch.SftpWagon.setFileMode(SftpWagon.java:143)
      at org.apache.maven.wagon.providers.ssh.jsch.SftpWagon.put(SftpWagon.java:88)
      ... 24 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 7 seconds
      [INFO] Finished at: Mon Oct 20 13:26:02 CEST 2008
      [INFO] Final Memory: 6M/125M
      [INFO] ------------------------------------------------------------------------

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              havwig HÃ¥vard Wigtil
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: