org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)

Jenkins JIRA | Stian Soiland-Reyes | 5 years ago
  1. 0

    Building a Maven project on a slave with _Use private Maven repository_ breaks the "Redeploy artifacts" functionality. Work-around: After the build, change setting to [ ] _Use private maven repository_ and _Redeploy_. The correct artifacts from the private repository are deployed. Project http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/ gives: {code} [INFO] Deployment in file:///tmp/test1337 (id=test1337,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code} Note: {{/home/jenkins/jenkins/}} is the path of the *slave*. Master is in {{/local/hudson}}. To reproduce: * Set up a slave, disable builds on master (alternatively - tie build to slave) * Create a new Jenkins project for Maven 2/3. ** Source code: GIT - {{git://github.com/stain/helloworld.git}} (Problem also exists with Subversion) ** Build - Goals and options: {{clean install}} *** Advanced: [x] Use private Maven repository * *Save*, then *Build Now*. * Go to _Last Successful Build_. * Click *Redeploy Artifacts*. * Advanced: ** Repository URL: {{file:///tmp/example}} ** Repository ID: {{example}} ** [x] Assign unique versions to snapshots (fails with both settings) ** *OK* This seems related to JENKINS-8711. Note - changing the configuration to do a Post-build deploy works: * Post-build actions ** (Same settings as above) ** *Save*, *Build* See http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/2/console for successful deployment. {code} [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jul 22 10:39:58 BST 2011 [INFO] Final Memory: 14M/34M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote jenkins-vm.taverna.org.uk maven settings from : /home/jenkins/.m2/settings.xml [INFO] Deployment in file:///tmp/example (id=example,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar [INFO] Deployment done in 0.28 sec Finished: SUCCESS {code} The files got correctly deployed on {{/tmp}} of the _master_ (and not on the slave): {code} root@rosalind-) ls /tmp/example/com/example/helloworld/ 0.0.1-SNAPSHOT maven-metadata.xml.md5 maven-metadata.xml maven-metadata.xml.sha1 {code} However, redeploy from this build does not work. Later changing the configuration to *NOT _Use private Maven repository_* and rebuilding works: http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ {code} [INFO] Deployment in file:///tmp/example3 (id=example3,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} In fact - this allows redeploying on the initial build 1 as well! http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/2/ {code} [INFO] Deployment in file:///tmp/test5 (id=test5,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} When checking the md5-sums on the deployed folder on the master: {code} root@rosalind-) md5sum /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar 980f75ad9126031ff46f2ee03dcc64e9 /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar {code} These matches the original build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ and not the latest non-private build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ .. so Jenkins did deploy the right version from the private repository. As a counter-example, change the setting back to use the private repository and try to redeploy build 4 (build without private): http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ fails with similar stack trace: {code} [INFO] Deployment in file:///tmp/example13 (id=example13,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code}

    Jenkins JIRA | 5 years ago | Stian Soiland-Reyes
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)
  2. 0

    Building a Maven project on a slave with _Use private Maven repository_ breaks the "Redeploy artifacts" functionality. Work-around: After the build, change setting to [ ] _Use private maven repository_ and _Redeploy_. The correct artifacts from the private repository are deployed. Project http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/ gives: {code} [INFO] Deployment in file:///tmp/test1337 (id=test1337,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code} Note: {{/home/jenkins/jenkins/}} is the path of the *slave*. Master is in {{/local/hudson}}. To reproduce: * Set up a slave, disable builds on master (alternatively - tie build to slave) * Create a new Jenkins project for Maven 2/3. ** Source code: GIT - {{git://github.com/stain/helloworld.git}} (Problem also exists with Subversion) ** Build - Goals and options: {{clean install}} *** Advanced: [x] Use private Maven repository * *Save*, then *Build Now*. * Go to _Last Successful Build_. * Click *Redeploy Artifacts*. * Advanced: ** Repository URL: {{file:///tmp/example}} ** Repository ID: {{example}} ** [x] Assign unique versions to snapshots (fails with both settings) ** *OK* This seems related to JENKINS-8711. Note - changing the configuration to do a Post-build deploy works: * Post-build actions ** (Same settings as above) ** *Save*, *Build* See http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/2/console for successful deployment. {code} [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jul 22 10:39:58 BST 2011 [INFO] Final Memory: 14M/34M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote jenkins-vm.taverna.org.uk maven settings from : /home/jenkins/.m2/settings.xml [INFO] Deployment in file:///tmp/example (id=example,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar [INFO] Deployment done in 0.28 sec Finished: SUCCESS {code} The files got correctly deployed on {{/tmp}} of the _master_ (and not on the slave): {code} root@rosalind-) ls /tmp/example/com/example/helloworld/ 0.0.1-SNAPSHOT maven-metadata.xml.md5 maven-metadata.xml maven-metadata.xml.sha1 {code} However, redeploy from this build does not work. Later changing the configuration to *NOT _Use private Maven repository_* and rebuilding works: http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ {code} [INFO] Deployment in file:///tmp/example3 (id=example3,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} In fact - this allows redeploying on the initial build 1 as well! http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/2/ {code} [INFO] Deployment in file:///tmp/test5 (id=test5,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} When checking the md5-sums on the deployed folder on the master: {code} root@rosalind-) md5sum /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar 980f75ad9126031ff46f2ee03dcc64e9 /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar {code} These matches the original build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ and not the latest non-private build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ .. so Jenkins did deploy the right version from the private repository. As a counter-example, change the setting back to use the private repository and try to redeploy build 4 (build without private): http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ fails with similar stack trace: {code} [INFO] Deployment in file:///tmp/example13 (id=example13,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code}

    Jenkins JIRA | 5 years ago | Stian Soiland-Reyes
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)
  3. 0

    Building a Maven project on a slave with _Use private Maven repository_ breaks the "Redeploy artifacts" functionality. *Work-around:* After the build, change setting to [ ] _Use private maven repository_ and _Redeploy_. The correct artifacts from the private repository are deployed. *Stack trace:* Project http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/ gives: {code} [INFO] Deployment in file:///tmp/test1337 (id=test1337,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code} Note: {{/home/jenkins/jenkins/}} is the path of the *slave*. Master is in {{/local/hudson}}. *To reproduce:* * Set up a slave, disable builds on master (alternatively - tie build to slave) * Create a new Jenkins project for Maven 2/3. ** Source code: GIT - {{git://github.com/stain/helloworld.git}} (Problem also exists with Subversion) ** Build - Goals and options: {{clean install}} *** Advanced: [x] Use private Maven repository * *Save*, then *Build Now*. * Go to _Last Successful Build_. * Click *Redeploy Artifacts*. * Advanced: ** Repository URL: {{file:///tmp/example}} ** Repository ID: {{example}} ** [x] Assign unique versions to snapshots (fails with both settings) ** *OK* *Analysis* This seems related to JENKINS-8711. Note - changing the configuration to do a Post-build deploy works: * Post-build actions ** (Same settings as above) ** *Save*, *Build* See http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/2/console for successful deployment. {code} [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jul 22 10:39:58 BST 2011 [INFO] Final Memory: 14M/34M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote jenkins-vm.taverna.org.uk maven settings from : /home/jenkins/.m2/settings.xml [INFO] Deployment in file:///tmp/example (id=example,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar [INFO] Deployment done in 0.28 sec Finished: SUCCESS {code} The files got correctly deployed on {{/tmp}} of the _master_ (and not on the slave): {code} root@rosalind-) ls /tmp/example/com/example/helloworld/ 0.0.1-SNAPSHOT maven-metadata.xml.md5 maven-metadata.xml maven-metadata.xml.sha1 {code} However, redeploy from this build does not work. Later changing the configuration to *NOT _Use private Maven repository_* and rebuilding works: http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ {code} [INFO] Deployment in file:///tmp/example3 (id=example3,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} In fact - this allows redeploying on the initial build 1 as well! http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/2/ {code} [INFO] Deployment in file:///tmp/test5 (id=test5,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} When checking the md5-sums on the deployed folder on the master: {code} root@rosalind-) md5sum /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar 980f75ad9126031ff46f2ee03dcc64e9 /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar {code} These matches the original build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ and not the latest non-private build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ .. so Jenkins did deploy the right version from the private repository. As a counter-example, change the setting back to use the private repository and try to redeploy build 4 (build without private): http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ fails with similar stack trace: {code} [INFO] Deployment in file:///tmp/example13 (id=example13,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code}

    Jenkins JIRA | 5 years ago | Stian Soiland-Reyes
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Building a Maven project on a slave with _Use private Maven repository_ breaks the "Redeploy artifacts" functionality. *Work-around:* After the build, change setting to [ ] _Use private maven repository_ and _Redeploy_. The correct artifacts from the private repository are deployed. *Stack trace:* Project http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/ gives: {code} [INFO] Deployment in file:///tmp/test1337 (id=test1337,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code} Note: {{/home/jenkins/jenkins/}} is the path of the *slave*. Master is in {{/local/hudson}}. *To reproduce:* * Set up a slave, disable builds on master (alternatively - tie build to slave) * Create a new Jenkins project for Maven 2/3. ** Source code: GIT - {{git://github.com/stain/helloworld.git}} (Problem also exists with Subversion) ** Build - Goals and options: {{clean install}} *** Advanced: [x] Use private Maven repository * *Save*, then *Build Now*. * Go to _Last Successful Build_. * Click *Redeploy Artifacts*. * Advanced: ** Repository URL: {{file:///tmp/example}} ** Repository ID: {{example}} ** [x] Assign unique versions to snapshots (fails with both settings) ** *OK* *Analysis* This seems related to JENKINS-8711. Note - changing the configuration to do a Post-build deploy works: * Post-build actions ** (Same settings as above) ** *Save*, *Build* See http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/2/console for successful deployment. {code} [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jul 22 10:39:58 BST 2011 [INFO] Final Memory: 14M/34M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote jenkins-vm.taverna.org.uk maven settings from : /home/jenkins/.m2/settings.xml [INFO] Deployment in file:///tmp/example (id=example,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar [INFO] Deployment done in 0.28 sec Finished: SUCCESS {code} The files got correctly deployed on {{/tmp}} of the _master_ (and not on the slave): {code} root@rosalind-) ls /tmp/example/com/example/helloworld/ 0.0.1-SNAPSHOT maven-metadata.xml.md5 maven-metadata.xml maven-metadata.xml.sha1 {code} However, redeploy from this build does not work. Later changing the configuration to *NOT _Use private Maven repository_* and rebuilding works: http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ {code} [INFO] Deployment in file:///tmp/example3 (id=example3,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} In fact - this allows redeploying on the initial build 1 as well! http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/2/ {code} [INFO] Deployment in file:///tmp/test5 (id=test5,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} When checking the md5-sums on the deployed folder on the master: {code} root@rosalind-) md5sum /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar 980f75ad9126031ff46f2ee03dcc64e9 /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar {code} These matches the original build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ and not the latest non-private build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ .. so Jenkins did deploy the right version from the private repository. As a counter-example, change the setting back to use the private repository and try to redeploy build 4 (build without private): http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ fails with similar stack trace: {code} [INFO] Deployment in file:///tmp/example13 (id=example13,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code}

    Jenkins JIRA | 5 years ago | Stian Soiland-Reyes
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)
  6. 0

    Building a Maven project on a slave with _Use private Maven repository_ breaks the "Redeploy artifacts" functionality. Work-around: After the build, change setting to [ ] _Use private maven repository_ and _Redeploy_. The correct artifacts from the private repository are deployed. Project http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/ gives: {code} [INFO] Deployment in file:///tmp/test1337 (id=test1337,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-test1337.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code} Note: {{/home/jenkins/jenkins/}} is the path of the *slave*. Master is in {{/local/hudson}}. To reproduce: * Set up a slave, disable builds on master (alternatively - tie build to slave) * Create a new Jenkins project for Maven 2/3. ** Source code: GIT - {{git://github.com/stain/helloworld.git}} (Problem also exists with Subversion) ** Build - Goals and options: {{clean install}} *** Advanced: [x] Use private Maven repository * *Save*, then *Build Now*. * Go to _Last Successful Build_. * Click *Redeploy Artifacts*. * Advanced: ** Repository URL: {{file:///tmp/example}} ** Repository ID: {{example}} ** [x] Assign unique versions to snapshots (fails with both settings) ** *OK* This seems related to JENKINS-8711. Note - changing the configuration to do a Post-build deploy works: * Post-build actions ** (Same settings as above) ** *Save*, *Build* See http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/2/console for successful deployment. {code} [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Jul 22 10:39:58 BST 2011 [INFO] Final Memory: 14M/34M [INFO] ------------------------------------------------------------------------ channel stopped Maven RedeployPublished use remote jenkins-vm.taverna.org.uk maven settings from : /home/jenkins/.m2/settings.xml [INFO] Deployment in file:///tmp/example (id=example,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar [INFO] Deployment done in 0.28 sec Finished: SUCCESS {code} The files got correctly deployed on {{/tmp}} of the _master_ (and not on the slave): {code} root@rosalind-) ls /tmp/example/com/example/helloworld/ 0.0.1-SNAPSHOT maven-metadata.xml.md5 maven-metadata.xml maven-metadata.xml.sha1 {code} However, redeploy from this build does not work. Later changing the configuration to *NOT _Use private Maven repository_* and rebuilding works: http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ {code} [INFO] Deployment in file:///tmp/example3 (id=example3,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} In fact - this allows redeploying on the initial build 1 as well! http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/redeploy/2/ {code} [INFO] Deployment in file:///tmp/test5 (id=test5,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar Completed {code} When checking the md5-sums on the deployed folder on the master: {code} root@rosalind-) md5sum /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar 980f75ad9126031ff46f2ee03dcc64e9 /tmp/test5/com/example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-20110722.094641-1.jar {code} These matches the original build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/1/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ and not the latest non-private build http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/com.example$helloworld/artifact/com.example/helloworld/0.0.1-SNAPSHOT/helloworld-0.0.1-SNAPSHOT.jar/*fingerprint*/ .. so Jenkins did deploy the right version from the private repository. As a counter-example, change the setting back to use the private repository and try to redeploy build 4 (build without private): http://www.mygrid.org.uk/jenkins/job/com.example.helloworld/4/redeploy/ fails with similar stack trace: {code} [INFO] Deployment in file:///tmp/example13 (id=example13,uniqueVersion=true) Deploying the main artifact helloworld-0.0.1-SNAPSHOT.jar org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:141) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:418) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260) at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215) at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137) ... 4 more Caused by: org.sonatype.aether.RepositoryException: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:125) at org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73) at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414) ... 8 more Caused by: java.io.FileNotFoundException: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59) at org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117) at org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120) ... 10 more {code}

    Jenkins JIRA | 5 years ago | Stian Soiland-Reyes
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to update metadata com.example:helloworld:0.0.1-SNAPSHOT/maven-metadata.xml: Could not write metadata /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml: /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    /home/jenkins/jenkins/workspace/com.example.helloworld/.repository/com/example/helloworld/0.0.1-SNAPSHOT/maven-metadata-example13.xml (No such file or directory)

    at java.io.FileOutputStream.open()
  2. Java RT
    FileOutputStream.<init>
    1. java.io.FileOutputStream.open(Native Method)
    2. java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    3. java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    3 frames
  3. Plexus Common Utilities
    WriterFactory.newXmlWriter
    1. org.codehaus.plexus.util.xml.XmlStreamWriter.<init>(XmlStreamWriter.java:59)
    2. org.codehaus.plexus.util.WriterFactory.newXmlWriter(WriterFactory.java:117)
    2 frames
  4. Maven Aether Provider
    MavenMetadata.merge
    1. org.apache.maven.repository.internal.MavenMetadata.write(MavenMetadata.java:120)
    2. org.apache.maven.repository.internal.MavenMetadata.merge(MavenMetadata.java:73)
    2 frames
  5. Aether :: Implementation
    DefaultRepositorySystem.deploy
    1. org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeployer.java:414)
    2. org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:260)
    3. org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:215)
    4. org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:480)
    4 frames
  6. Maven
    DefaultArtifactDeployer.deploy
    1. org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:137)
    1 frame
  7. Legacy Maven 2 job type Plugin
    MavenAbstractArtifactRecord$1.perform
    1. hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:189)
    2. hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:95)
    3. hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:233)
    3 frames
  8. Hudson
    TaskThread.run
    1. hudson.model.TaskThread.run(TaskThread.java:126)
    1 frame