开发者

Maven Ant 2.1.3 dependencies task does not work with type filter

I am using Maven Ant Tasks library to automatically resolve dependencies. I am trying to use "type" filter in "dependencies" task. Task works only if I do not add "type" filter. Even default value "jar" does not resolve any dependency. Removing type filter selects all dependencies which is around 50, but I need 开发者_如何学编程just 4. I specifically want "ejb-client" dependencies selected. It works if I manually specify my dependencies. Below is two set of codes. First one does not work when I add "type", second one works. Can anyone help me resolve this.

    <artifact:dependencies filesetId="dependency.war.lib.fileset" pomRefId="war" type="jar"/>

    <artifact:dependencies filesetId="dependency.war.lib.fileset">
        <dependency groupId="xxxx" artifactId="xxx" version="1.0.0" type="ejb-client" />
    </artifact:dependencies>


I think you are confusing file-type and packaging type of the POM ( that's the value referred by the type attribute ).

Here is what POM reference has to say about dependency type:

Corresponds to the dependant artifact's packaging type. This defaults to jar. While it usually represents the extension on the filename of the dependency, that is not always the case. A type can be mapped to a different extension and a classifier. The type often corresponds to the packaging used, though this is also not always the case. Some examples are jar, ejb-client and test-jar. New types can be defined by plugins that set extensions to true, so this is not a complete list.

I speculate, that because pomRefId on your first line has a value of war, the valid value for type would be war and not jar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜