Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0.4
-
Fix Version/s: 2.0.4
-
Component/s: Dependencies
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
Cargo is now failing to build with v2.0.4-SNAPSHOT as shown below. I believe the problem is because we have the following structure
trunk/
|_ samples/
|_ testdata/
where testdata's POM refers to the POM in trunk.
Error log:
C:\dev\cargo\trunk>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.codehaus.cargo
ArtifactId: cargo
Version: 0.9-SNAPSHOT
Reason: Unable to download the artifact from any repository
org.codehaus.cargo:cargo:pom:0.9-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.codehaus.cargo:cargo for p
roject: org.codehaus.cargo:cargo-samples-testdata:pom:null
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:278)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
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.project.ProjectBuildingException: Cannot find parent: org.codehaus.cargo
:cargo for project: org.codehaus.cargo:cargo-samples-testdata:pom:null
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBu
ilder.java:1132)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuil
der.java:672)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMa
venProjectBuilder.java:414)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java
:190)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:515)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:447)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:351)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.codehaus.cargo:cargo' not fou
nd in repository: Unable to download the artifact from any repository
org.codehaus.cargo:cargo:pom:0.9-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenP
rojectBuilder.java:511)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBu
ilder.java:1128)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the arti
fact from any repository
org.codehaus.cargo:cargo:pom:0.9-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolve
r.java:136)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolve
r.java:63)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenP
rojectBuilder.java:465)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact fro
m any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.jav
a:260)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolve
r.java:124)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Apr 01 08:14:30 CEST 2006
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------
C:\dev\cargo\trunk>
see it0103.
Vincent, see below for some comments I have related to your specific POM.
The fix involved adding a raw-project cache to the project builder.
MNG-2054was the flip-side of this problem, in that it had a problem that came from using the processed-project cache for assembling the project lineage that would eventually be used for inheritance...in that case, projects which had already had inheritance operations performed on them were causing multiple inheritance of the same configuration from ancestor POMs.In this case, turning off that caching means that POMs which have broken <relativePath/> links to the parent POM, and whose parent POMs are not in the repository, will not be able to find their parent in a multimodule build - even though the parent has been cached as part of the current build process. To fix this, I've implemented raw-project caching, which are the project instances without interpolation, inheritance, etc. operations performed on them. This allows assembleLineage(..) to lookup and use these POMs, and have subsequent inheritance operations succeed without injecting the same config multiple times.
Vincent, although this use case has been fixed in SVN, I'd strongly suggest you add a relativePath element to the testdata POM's parent section, so it can be built in isolation, even if the parent POM isn't in the repository.