[ http://jira.codehaus.org/browse/MNG-3439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Fox closed MNG-3439. -------------------------- Assignee: Brian Fox Resolution: Fixed Fix Version/s: 2.0.9 this is a bug in the mock source object. Should not affect runtime. > incorrect child dependency selected when parent is not selected > --------------------------------------------------------------- > > Key: MNG-3439 > URL: http://jira.codehaus.org/browse/MNG-3439 > Project: Maven 2 > Issue Type: Bug > Components: Artifacts and Repositories > Affects Versions: 2.0.8 > Reporter: Brian Fox > Assignee: Brian Fox > Fix For: 2.0.9 > > > I'm writing unit tests to reproduce MNG-2123 and I found a separate issue. I > did the following > a 1.0 ->b 1.0->c3.2->d1.1 > a 1.0 ->e1.0->c[1.0,3.0]->d1.0 > The available versions are c2.5,c3.2,d1.0,d1.1 > The resulting list is including d1.1 not 1.0 > d1.1 comes from the c3.2 which is not included, c2.5 was and thus d1.0 should > have been. > {noformat} > public void testCompatibleRecommendedVersionWithChildren() > throws ArtifactResolutionException, > InvalidVersionSpecificationException > { > // this test puts two dependencies on C with 3.2 and [1.0,3.0] as the > version. > // it puts 2.5 in the pretend repo...we should get back 2.5 > ArtifactSpec a = createArtifactSpec( "a", "1.0" ); > ArtifactSpec b = a.addDependency( "b", "1.0" ); > ArtifactSpec e = a.addDependency( "e", "1.0" ); > ArtifactSpec c1 = b.addDependency( "c", "3.2" ); > ArtifactSpec d1 = c1.addDependency( "d","1.1" ); > e.addDependency( "c", "[1.0,3.0]" ); > // put it in the repo > ArtifactSpec c = createArtifactSpec( "c", "2.5" ); > ArtifactSpec d = c.addDependency( "d","1.0" ); > > source.addArtifact( c ); > source.addArtifact( d ); > source.addArtifact( c1 ); > source.addArtifact( d1 ); > ArtifactResolutionResult res = collect( a ); > assertEquals( "Check artifact list", > createSet( new Object[] { a.artifact, b.artifact, > e.artifact, c.artifact,d.artifact } ), res.getArtifacts() ); > assertEquals( "Check version", "2.5", getArtifact( "c", > res.getArtifacts() ).getVersion() ); > } > {noformat} -- 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