Issue Details (XML | Word | Printable)

Key: MNG-3537
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Yan Huang
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Maven 2

"Nested imports" doesn't work on Maven 2.0.9

Created: 21/Apr/08 12:47 PM   Updated: 12/Jun/08 07:21 PM
Component/s: Artifacts and Repositories
Affects Version/s: 2.0.9
Fix Version/s: 2.0.x

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive sample.zip (2 kB)


Complexity: Intermediate
Testcase included: yes


 Description  « Hide
The "nested imports" doesn't work on Maven 2.0.9.

When trying to resolve "nested imports", Maven 2.0.9 kind of "forget" about the repositories that are defined in settings.xml and only tries to look up some of artifacts in "central" repository.

Here attaches the sample. The steps to produce this bug under Maven 2.0.9:
1. unzip this zip and it'll create a folder called "sample". There are 5 POM files under there.
2. deploy all sample*.xml to a Maven 2 repository by using "deploy:deploy-file".
3. run "mvn help:effective-pom" and it will fail. The sample/pom.xml imports "sample-1.0.0.0" POM which in turn imports all other sample-pom-[1-3] artifacts. The error messages are as belows. It's trying to look up artifacts ONLY in central repository.

>mvn help:effective-pom
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/test-nested-import/sample-pom-1/1.0.0.0/sample-pom-1-1.0.0.0.pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: test-nested-import
ArtifactId: sample-pom-1
Version: 1.0.0.0

Reason: Unable to download the artifact from any repository

test-nested-import:sample-pom-1:pom:1.0.0.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: POM 'test-nested-import:sample-pom-1' not found in repository: Unable
to download the artifact from any repository

test-nested-import:sample-pom-1:pom:1.0.0.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project test-nested-import:sample-pom-1
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
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.project.ProjectBuildingException: POM 'test-nested-import:sample-pom-1' not found in reposit
ory: Unable to download the artifact from any repository

test-nested-import:sample-pom-1:pom:1.0.0.0

from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project test-nested-import:sample-pom-1
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:6
03)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:249)
at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:
1438)
at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1030)

at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:878)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:253)
at org.apache.maven.project.DefaultMavenProjectBuilder.mergeManagedDependencies(DefaultMavenProjectBuilder.java:
1438)
at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1030)

at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:878)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.ja
va:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any reposi
tory



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Brett Porter added a comment - 12/Jun/08 06:23 PM
is this a regression, or a problem with the new feature in 2.0.9?

Yan Huang added a comment - 12/Jun/08 07:21 PM
It's a bug with the new feature in 2.0.9. That attachment can reproduce this bug.