You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Lin Zhu (JIRA)" <ji...@codehaus.org> on 2008/07/01 20:22:26 UTC

[jira] Commented: (MNG-3643) maven-metadata-.xml not generated when deploying to repository via scpexe protocol

    [ http://jira.codehaus.org/browse/MNG-3643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140109#action_140109 ] 

Lin Zhu commented on MNG-3643:
------------------------------

Running maven 2.0.9 on Linux. I'm seeing the same issue from MNG-925. 

{quote}
$ mvn -N -e -s /home/lz02/settings.xml deploy 
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Environment repository
[INFO]    task-segment: [deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /home/lz02/Projects/example/env/trunk/pom.xml to /home/lz02/.m2/repository/com/example/env/env/1.6-SNAPSHOT/env-1.6-SNAPSHOT.pom
[INFO] [deploy:deploy]
altDeploymentRepository = null
[INFO] Retrieving previous build number from inhouse.snapshot
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error retrieving previous build number for artifact 'com.example.env:env:pom': repository metadata for: 'snapshot com.example.env:env:1.6-SNAPSHOT' could not be retrieved from repository: inhouse.snapshot due to an error: Failed to post-process the source file

/home/lz02/.m2/repository/com/example/env/env/1.6-SNAPSHOT/maven-metadata-inhouse.snapshot.xml.tmp (No such file or directory)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error retrieving previous build number for artifact 'com.example.env:env:pom': repository metadata for: 'snapshot com.example.env:env:1.6-SNAPSHOT' could not be retrieved from repository: inhouse.snapshot due to an error: Failed to post-process the source file
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
	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:585)
	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 retrieving previous build number for artifact 'com.example.env:env:pom': repository metadata for: 'snapshot com.example.env:env:1.6-SNAPSHOT' could not be retrieved from repository: inhouse.snapshot due to an error: Failed to post-process the source file
	at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:174)
	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 retrieving previous build number for artifact 'com.example.env:env:pom': repository metadata for: 'snapshot com.example.env:env:1.6-SNAPSHOT' could not be retrieved from repository: inhouse.snapshot due to an error: Failed to post-process the source file
	at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:106)
	at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransformationManager.java:78)
	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:71)
	at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:152)
	... 18 more
Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException: repository metadata for: 'snapshot com.example.env:env:1.6-SNAPSHOT' could not be retrieved from repository: inhouse.snapshot due to an error: Failed to post-process the source file
	at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:352)
	at org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java:161)
	at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:100)
	... 21 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to post-process the source file
	at org.apache.maven.wagon.AbstractWagon.postProcessListeners(AbstractWagon.java:624)
	at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.get(ScpExternalWagon.java:344)
	at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:470)
	at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadataFromDeploymentRepository(DefaultWagonManager.java:379)
	at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.getArtifactMetadataFromDeploymentRepository(DefaultRepositoryMetadataManager.java:380)
	at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:348)
	... 23 more
Caused by: java.io.FileNotFoundException: /home/lz02/.m2/repository/com/example/env/env/1.6-SNAPSHOT/maven-metadata-inhouse.snapshot.xml.tmp (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.apache.maven.wagon.AbstractWagon.postProcessListeners(AbstractWagon.java:608)
	... 28 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Tue Jul 01 13:59:04 EDT 2008
[INFO] Final Memory: 9M/16M
[INFO] ------------------------------------------------------------------------
{quote}

> maven-metadata-<repository>.xml not generated when deploying to repository via scpexe protocol
> ----------------------------------------------------------------------------------------------
>
>                 Key: MNG-3643
>                 URL: http://jira.codehaus.org/browse/MNG-3643
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>         Environment: Linux u-235 2.6.10-gentoo-r4 #1 SMP Mon Jan 10 14:53:56 EST 2005 i686 AMD Athlon(tm) MP 2400+ AuthenticAMD GNU/Linux
> java version "1.4.2_08"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
> Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
>            Reporter: Lin Zhu
>            Assignee: Brett Porter
>
> Further to the below, if I deploy a project to the remote repository
> successfully via NFS and then switch over to scpexe, subsequent
> deployments over scpexe work as expected.
> This appears to be due to the presence of the maven-metadata.xml files
> in the repository. If I remove these the deployment breaks again.
> The root problem appears to be with the deployment and/or generation of
> the metadata when using scpexe.
> When broken, the root exception in the stack trace is:
> Caused by: java.io.FileNotFoundException:
> /home/amm/.m2/repository/com/distra/useful/useful/maven-metadata-distra.xml.tmp
> (No such file or directory)
> Checking my local repository reveals that the maven-metadata-distra.xml
> has not been generated. maven-metadata-local.xml is still generated.
> maven-metadata-distra.xml IS generated when deploying via NFS.
> So, in a nutshell, maven-metadata-<repository>.xml does not appear to be
> generated correctly when using the scpexe protocol.
> Would anyone care to confirm this before I raise a bug?
> I have tested with the normal scp protocol and deployment works as
> expected. Using scp however I have to hard-code my key's password in
> settings.xml. This is what I am trying to get around by using scpexe.
> Thanks,
> ...andrew
> andrew wrote:
> >> Maven version: 2.0-beta-1
> >> 
> >> Hi,
> >> 
> >> Thanks to the maven devs for getting 2.0-beta-1 released. All the hard
> >> work is much appreciated.
> >> 
> >> When attempting to deploy to a remote repository (via scpexe) with the
> >> new release I am getting a few exceptions [1].
> >> 
> >> The jar is uploaded to the repository correctly, however the POM is not
> >> and the build fails with the metadata related exceptions below.
> >> 
> >> The scpexe protocol appears to be working correctly for the upload but
> >> some maven internal metadata processing doesn't like it.
> >> 
> >> If I deploy to the same server path over NFS, everything works as expected.
> >> 
> >> My project POM [2] and local settings.xml [3] are also attached.
> >> 
> >> Any insight into this issue much appreciated.
> >> 
> >> Thanks,
> >> ...andrew
> >> 
> >> Listing 1:
> >> 
> >> $ m2 -Dmaven.test.skip=true clean:clean deploy
> >> [INFO] Searching repository for plugin with prefix: 'clean'.
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [INFO] Building distra - useful
> >> [INFO]    task-segment: [clean:clean, deploy]
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [INFO] [clean:clean]
> >> [INFO] Deleting directory
> >> /secure/home/amm/prj/bt3/distra/useful/useful/target
> >> [INFO] [resources:resources]
> >> Downloading:
> >> http://repo1.maven.org/maven2/sun/java/tools/tools/1.4.2_08/tools-1.4.2_08.pom
> >> [WARNING] Unable to get resource from repository central
> >> (http://repo1.maven.org/maven2)
> >> [WARNING]
> >>   ***** Using defaults for missing POM sun.java.tools:tools:pom:1.4.2_08
> >> *****
> >> 
> >> [INFO] [compiler:compile]
> >> Compiling 211 source files to
> >> /secure/home/amm/prj/bt3/distra/useful/useful/target/classes
> >> [INFO] [resources:testResources]
> >> [INFO] [compiler:testCompile]
> >> Compiling 73 source files to
> >> /secure/home/amm/prj/bt3/distra/useful/useful/target/test-classes
> >> [INFO] [surefire:test]
> >> [INFO] Tests are skipped.
> >> [INFO] [jar:jar]
> >> [INFO] Building jar:
> >> /secure/home/amm/prj/bt3/distra/useful/useful/target/useful-1.0.jar
> >> [INFO] [install:install]
> >> [INFO] Installing
> >> /secure/home/amm/prj/bt3/distra/useful/useful/target/useful-1.0.jar to
> >> /home/amm/.m2/repository/com/distra/useful/useful/1.0/useful-1.0.jar
> >> [INFO] [deploy:deploy]
> >> Uploading:
> >> scpexe://office/data/development/bt3/m2/distra/com/distra/useful/useful/1.0/useful-1.0.jar
> >> [INFO] Retrieving previous metadata from distra
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [ERROR] BUILD ERROR
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [INFO] Diagnosis: Error deploying artifact
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [ERROR] Cause:
> >> 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(DefaultPluginManager.java:357)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
> >>         at
> >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131)
> >>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
> >>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:302)
> >>         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: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(DefaultArtifactDeployer.java:89)
> >>         at
> >> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.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.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:212)
> >>         at
> >> org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:230)
> >>         at
> >> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:77)
> >>         ... 18 more
> >> Caused by: org.apache.maven.wagon.TransferFailedException: Failed to
> >> post-process the source file
> >>         at
> >> org.apache.maven.wagon.AbstractWagon.postProcessListeners(AbstractWagon.java:547)
> >>         at
> >> org.apache.maven.wagon.providers.sshext.ScpExternalWagon.get(ScpExternalWagon.java:307)
> >>         at
> >> org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:325)
> >>         at
> >> org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:256)
> >>         at
> >> org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:198)
> >>         ... 20 more
> >> Caused by: java.io.FileNotFoundException:
> >> /home/amm/.m2/repository/com/distra/useful/useful/maven-metadata-distra.xml.tmp
> >> (No such file or directory)
> >>         at java.io.FileInputStream.open(Native Method)
> >>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
> >>         at
> >> org.apache.maven.wagon.AbstractWagon.postProcessListeners(AbstractWagon.java:531)
> >>         ... 24 more
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> [INFO] Total time: 14 seconds
> >> [INFO] Finished at: Mon Sep 19 11:41:06 EST 2005
> >> [INFO] Final Memory: 4M/17M
> >> [INFO]
> >> ----------------------------------------------------------------------------
> >> 
> >> Listing 2: pom.xml
> >> 
> >> <project
> >>   xmlns="http://maven.apache.org/POM/4.0.0"
> >>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> >> http://maven.apache.org/maven-v4_0_0.xsd">
> >>   <modelVersion>4.0.0</modelVersion>
> >>   <groupId>com.distra.useful</groupId>
> >>   <artifactId>useful</artifactId>
> >>   <packaging>jar</packaging>
> >>   <version>1.0</version>
> >>   <name>distra - useful</name>
> >>   <url>http://www.distra.com</url>
> >>   <distributionManagement>
> >>     <repository>
> >>       <id>distra</id>
> >>       <url>scpexe://office/data/development/bt3/m2/distra</url>
> >> <!--
> >>       NFS mounted path works as expected
> >>       <url>file:///office/data/development/bt3/m2/distra</url>
> >> -->
> >>     </repository>
> >>   </distributionManagement>
> >>   <build>
> >>     <extensions>
> >>       <extension>
> >>         <groupId>org.apache.maven.wagon</groupId>
> >>         <artifactId>wagon-ssh-external</artifactId>
> >>         <version>1.0-alpha-4</version>
> >>       </extension>
> >>     </extensions>
> >>   </build>
> >> </project>
> >> 
> >> Listing 3: settings.xml
> >> 
> >> <settings>
> >>   <servers>
> >>     <server>
> >>       <id>distra</id>
> >>       <username>amm</username>
> >>     </server>
> >>   </servers>
> >>   <profiles>
> >>     <profile>
> >>       <id>default</id>
> >>       <repositories>
> >>         <repository>
> >>           <id>distra</id>
> >>           <name>Distra libraries</name>
> >>           <url>scpexe://office/data/development/bt3/m2/distra</url>
> >>         </repository>
> >>       </repositories>
> >>     </profile>
> >>   </profiles>
> >> </settings>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira