maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Brouwer (JIRA)" <>
Subject [jira] Commented: (MANTTASKS-41) type attribute of artifact:dependencies doesn't work for indirect dependencies
Date Fri, 26 Sep 2008 21:24:45 GMT


Bruce Brouwer commented on MANTTASKS-41:

I've just now been running into this problem as well. Is there any chance that this will be
looked into? 

In my own debugging, I found that it does all come down to that node.filterTrail(filter) call.
What I think needs to happen is that the TypeArtifactFilter needs to somehow not be called
for the root node, which in this example would be the war. This way, when we specify a type
of "jar", the filterTrail won't reject the root node of "war". Maybe this needs to be a new
filter: TransitiveTypeArtifactFilter which ignores root nodes.

I disagree, however, with Jeff Maxwell's solution. If I had a chain of war -> war ->
jar (I know it's a bad example), then I would not want the jar included. 

Maybe a better example would be if I'm trying to get all the jars for an ear. In this case
the node chain might be ear -> war -> jar. In this case, I would want *not* want this
JAR in my fileset, but I would want a JAR from a node chain of ear -> jar in my fileset.

> type attribute of artifact:dependencies doesn't work for indirect dependencies
> ------------------------------------------------------------------------------
>                 Key: MANTTASKS-41
>                 URL:
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Sub-task
>          Components: dependencies task
>            Reporter: Tomislav Bodor
>         Attachments: build.xml, pom.xml
> It appears that the type filter doesn't work properly with indirect dependencies. It
doesn't look like an issue with the TypeArtifactFilter itself, but somewhere deeper. However,
it's related to this feature, so here it is...
> The problem manifests with transitive dependencies that are of different type, e.g. a
war artefact depends on a jar library. Whatever the type in that case (jar or war), the dependency
list returned by artifact:dependencies is empty.
> I've traced through it and here is some more information:
> DefaultArtifactCollector applies the filter using ResolutionNode.filterTrail. This iterates
over the (dependency) node trail and applies the specified filter to each dependency in turn.
If all dependencies are of the same type and the type matches the one specified in the filter,
no problems. However, I've got a dependency that is a war archive and that in turn has some
jar dependencies. If type is set to jar, filter fails when testing the first dependency in
the trail - the war in this case and never gets to the jar. The result is that whatever the
value of the type attribute, the dependency list always ends up empty for trails that contain
dependencies of different types.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message