maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Nicoll (JIRA)" <>
Subject [jira] Closed: (MWAR-251) parent project dependencyManagement for test submodule causes adding unnecessary libraries to war
Date Wed, 16 Mar 2011 07:22:22 GMT


Stephane Nicoll closed MWAR-251.

    Resolution: Not A Bug
      Assignee: Stephane Nicoll

This has nothing to do with the war plugin, please go through the maven user list for user

The dependency:tree of your war project is the following

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ WarProject ---
[INFO] net.croz.vvidovic.test:WarProject:war:0.0.1-SNAPSHOT
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- net.croz.vvidovic.test:TestProject:jar:0.0.1-SNAPSHOT:test
[INFO] |  \- log4j:log4j:jar:1.2.15:compile (scope managed from test)
[INFO] |     +- javax.mail:mail:jar:1.4:compile
[INFO] |     |  \- javax.activation:activation:jar:1.1:compile
[INFO] |     +- javax.jms:jms:jar:1.1:compile
[INFO] |     +- com.sun.jdmk:jmxtools:jar:1.2.1:compile
[INFO] |     \- com.sun.jmx:jmxri:jar:1.2.1:compile
[INFO] \- junit:junit:jar:4.8.1:test

I strongly suggest you *NOT* to use scope in your dependencies management. You are the culprit
here. In your parent project you're saying explicitly that log4j has a "compile" scope. It's
perfectly normal that the war plugin bundles this dependency since you are overriding the
scope from the transitive dependencies

> parent project dependencyManagement for test submodule causes adding unnecessary libraries
to war
> -------------------------------------------------------------------------------------------------
>                 Key: MWAR-251
>                 URL:
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1-beta-1
>            Reporter: Vedran Vidovi&#263;
>            Assignee: Stephane Nicoll
>         Attachments:
> Unnecessary libraries are added in a war when we define transitive test dependencies
of submodule used in test scope of war project:
> - create a parent project with a war submodule and a jar submodule (in attachment: ParentProject,
WarProject, TestProject)
> - use depencencyManagement in parent pom.xml for setting versions of dependencies
> - add a dependency to jar submodule (which is declared in parent pom.xml in dependencyManagement)
> - add jar submodule as a dependency to war submodule in test scope
> - call "mvn clean package" on parent project
> --> dependencies of jar submodule will be copied to war's WEB-INF/lib directory (IT
> - if we don't add dependency for jar submodule to dependencyManagement in parent pom.xml
problem doesn't appear
> See attached zip of mvn project with two submodules.

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