[ http://jira.codehaus.org/browse/MNG-3067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100354 ]
Jason Melnick commented on MNG-3067: ------------------------------------ Note that the output towards the end was generated by using the following code: ArtifactFilter filter = new ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME); result = resolver.resolveTransitively(dependencyArtifacts, mavenProject.getArtifact(),local,remoteRepos, source, filter); Set nodes = result.getArtifactResolutionNodes(); for (Iterator iter = nodes.iterator(); iter.hasNext();) { ResolutionNode node = (ResolutionNode) iter.next(); if (!node.getArtifact().isOptional()) { logger.info(node.getArtifact().getArtifactId() + ": " + node.getDepth()); if (node.getDepth() == 1) { for (Iterator iter2 = node.getChildrenIterator(); iter2.hasNext();) { logger.info("\t child: " + iter2.next().toString()); } } } } Also, none of the non-child depth 2 dependencies are declared in this POM and are transitive dependencies of declared deps marked as optional. > Getting arbitrary depth=2 dependencies when using optional=true > --------------------------------------------------------------- > > Key: MNG-3067 > URL: http://jira.codehaus.org/browse/MNG-3067 > Project: Maven 2 > Issue Type: Bug > Components: Dependencies > Affects Versions: 2.0.6 > Reporter: Jason Melnick > > When using a dependency section like this in a WAR (just an excerpt - these > are not the culprit to my knowledge): > <dependency> > <groupId>xmlbeans</groupId> > <artifactId>xbean</artifactId> > <optional>true</optional> > </dependency> > <dependency> > <groupId>xmlbeans</groupId> > <artifactId>xbean_xpath</artifactId> > <optional>true</optional> > </dependency> > <dependency> > <groupId>xml-apis</groupId> > <artifactId>xml-apis</artifactId> > <optional>true</optional> > </dependency> > <dependency> > <groupId>xml-resolver</groupId> > <artifactId>xml-resolver</artifactId> > <optional>true</optional> > </dependency> > I am getting artifacts with a depth of 2 - when nothing should resolve. Only > depth 1 (non-optional deps, plus their deps, etc) should be resolving. i.e. > [INFO] mq: 2 > [INFO] mqjms: 2 > [INFO] spring-orm: 2 > [INFO] struts: 1 > [INFO] child: commons-beanutils:commons-beanutils:jar:1.6.1:compile > (2; disabled) > [INFO] child: commons-collections:commons-collections:jar:3.1:compile > (2; disabled) > [INFO] child: struts:struts-legacy:jar:1.1:compile (2; enabled) > [INFO] child: commons-digester:commons-digester:jar:1.6:compile (2; > disabled) > [INFO] child: commons-fileupload:commons-fileupload:jar:1.0:compile > (2; enabled) > [INFO] child: commons-lang:commons-lang:jar:2.1:compile (2; disabled) > [INFO] child: commons-logging:commons-logging:jar:1.0:compile (2; > disabled) > [INFO] child: commons-validator:commons-validator:jar:1.1.4:compile > (2; disabled) > [INFO] child: oro:oro:jar:2.0.7:compile (2; disabled) > [INFO] child: javax.sql:jdbc-stdext:jar:2.0:compile (2; enabled) > [INFO] commons-logging: 1 > [INFO] child: log4j:log4j:jar:1.2.6:compile (2; enabled) > [INFO] child: logkit:logkit:jar:1.0.1:compile (2; enabled) > [INFO] child: avalon-framework:avalon-framework:jar:4.1.3:compile (2; > enabled) > [INFO] distribution-service-client-jar: 2 > [INFO] jdbc-stdext: 2 > [INFO] struts-bean: 1 > [INFO] cmf-nol-submit-jar: 2 > [INFO] mqiiop: 2 > [INFO] distribution-service-ejb: 2 > [INFO] jaxen: 2 > [INFO] spring-dao: 2 > [INFO] struts-tiles: 1 > [INFO] cmf-final-jar: 2 > [INFO] struts-legacy: 2 > [INFO] standard: 1 > [INFO] saxpath: 2 > [INFO] jstl: 1 > [INFO] nw-exception: 1 > [INFO] relaxngDatatype: 2 > [INFO] mqbind: 2 > [INFO] struts-logic: 1 > [INFO] commons-fileupload: 2 > [INFO] isorelax: 2 > [INFO] spring-core: 2 > [INFO] log4j: 1 > [INFO] msv: 2 > [INFO] struts-nested: 1 > [INFO] nw-struts: 1 > [INFO] child: struts:struts:jar:1.1:compile (2; disabled) > [INFO] struts-html: 1 > [INFO] authorization-tag-jar: 1 > [INFO] child: commons-logging:commons-logging:jar:1.0.4:compile (2; > disabled) > [INFO] child: log4j:log4j:jar:1.2.7:compile (2; disabled) > [INFO] child: com.nationwide.common:nw-exception:jar:1.2.0:compile > (2; disabled) > [INFO] child: > com.nationwide.pc.claims.horizon:simple-security-client-jar:jar:2.0.0:compile > (2; disabled) -- 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