I'm using Maven 2.0.8 with maven-war-plugin version 2.1-alpha-2-SNAPSHOT.
The dependency is added although I specified an
exclusion in the pom.xml (see below):
pom.xml:
<build>
</plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<executions>
...
</executions>
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>${axis2.version}</version>
<exclusions>
<exclusion>
<groupId>xmlbeans</groupId>
<artifactId>xbean</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Executing maven with the -X switch set the following debug messages
are produced indicating that the dependency on xmlbeans:xbean
is already on the classpath for compiler:compile, etc.
The axis2-wsdl2code plugin seems to add this dependency though
specified as an exclusion.
...
[INFO] [axis2-wsdl2code:wsdl2code {execution: publisher-wsdl}]
...
[DEBUG] The artifact org.apache.ws.commons.axiom:axiom-api is already
present in the project and will not be added.
[DEBUG] The artifact org.apache.ws.commons.axiom:axiom-impl is already
present in the project and will not be added.
[DEBUG] The artifact commons-httpclient:commons-httpclient is already
present in the project and will not be added.
[DEBUG] The artifact wsdl4j:wsdl4j is already present in the project
and will not be added.
[DEBUG] Adding artifact org.apache.axis2:axis2-xmlbeans
[DEBUG] Adding artifact xmlbeans:xbean
[DEBUG] The projects dependency artifacts are:
[DEBUG] com.sun.facelets:jsf-facelets:1.1.13:null:compile:jar
[DEBUG] xmlbeans:xbean:2.2.0:null:compile:jar
...
...
[INFO] [compiler:testCompile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Classpath: [ ...
/home/felix/.m2/repository/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar
...]
...
...
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-surefire-plugin:2.4.1-SNAPSHOT:test' -->
...
[DEBUG] (f) classpathElements = [ ...
/home/felix/.m2/repository/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar, ... ]
...
[DEBUG] (f) projectArtifactMap = { ...
xmlbeans:xbean=xmlbeans:xbean:jar:2.2.0:compile, ... }
...
[DEBUG] Test Classpath :
[DEBUG] /home/felix/.m2/repository/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar
...
...
Finally the maven-war-module adds this plugin transitive dependency also:
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[publisher-webapp] in
[/home/felix/dev/lwp/publisher/publisher-webapp/target/publisher-webapp-1.0.0-SNAPSHOT]
[INFO] Processing war project
...
[DEBUG] Processing: xbean-2.2.0.jar
[DEBUG] * WEB-INF/lib/xbean-2.2.0.jar is up to date.
...
[INFO] Webapp assembled in[1437 msecs]
[INFO] Building war:
/home/felix/dev/lwp/publisher/publisher-webapp/target/publisher-webapp-1.0.0-SNAPSHOT.war
...
[DEBUG] adding entry WEB-INF/lib/xbean-2.2.0.jar
Any Ideas?
Felix
On 01/31/2008 12:03 PM, [EMAIL PROTECTED] wrote:
This is the first time I see that a plugin transitive dependency makes it into
the final
> artifact. What versions of maven and the maven-war-plugin are you using?
With regards,
Nick Stolwijk
-----Original Message-----
From: amit kumar [mailto:[EMAIL PROTECTED]
Sent: Thu 1/31/2008 11:56 AM
To: Maven Users List
Subject: Re: Dependency resolution of maven-war-plugin
Yes Felix maven-war-plugin does include the transitive dependencies.
For a transitive dependency of a plugin, the way(workaround) I found
and using is to declare that dependency explicitly in your pom.xml and
declare it to be available at only compile time ( <scope> tag).
For the transitive dependencies of the rest of the dependencies I am
using <exclusion> tag with in the dependency tag. That probably be not
the sanest way of it, but this was what I could find out with the help
of other maven users here on the list.
Amit
On Jan 31, 2008 4:20 PM, Felix Röthenbacher <[EMAIL PROTECTED]> wrote:
Hello
I have a question re dependency resolution of the maven-war-plugin.
If I run 'mvn install' a war is built including the library xbeans.jar
(xmlbeans:xbean is a transitive dependency of a plugin). Why is this
dependency included though not declared?
A check with 'mvn dependency:tree -Dincludes=xmlbeans:xbean' returns
with no result. It seems to me that maven-war-plugin includes also
transitive plugin dependencies.
Thanks for your help, Felix
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]