Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Maven 2.0.7, JDK 1.6.0_01-b06, JavaEE 5
-
Number of attachments :
Description
I have an EAR project (TestEAR) which contains two modules:
1. A JAR module (TestJAR) which has one dependency: commons-lang 2.3
2. A WAR module (TestWAR) which uses these instructions to declare a dependency on TestJAR so that TestJAR is included in TestWAR's manifest classpath, but not copied into WEB-INF/lib (i.e. declares the dependency optional).
This works fine for TestJAR itself, but its transitive dependency (commons-lang 2.3) is still copied into WEB-INF/lib. I don't believe this is the correct behavior since all dependencies of a JAR packaged in the EAR must also be packaged in the EAR. So, all a WAR should have to do is put the transitive dependencies in its manifest classpath to inherit them. Basically: in a WAR, transitive dependencies of "optional" dependencies should inherit the "optional" flag.
I have included a simple test project as an example. Unzip, cd TestProject, and mvn install. Look in TestEAR's target dir and you will see that commons-lang is included in the EAR. Then look in TestWAR's target dir and you will see that commons-lang is also included in both the manifest classpath and the WEB-INF/lib dir.
Issue Links
- is depended upon by
-
MECLIPSE-360
Optional web app dependencies are not treated the same way as maven-ear-plugin
-
- is duplicated by
-
MWAR-125
war manifest generation : optional=true not transitive
-
- relates to
-
MWAR-83
transitive dependency on POM artifact not respected
-