[ http://jira.codehaus.org/browse/MWAR-21?page=comments#action_61972 ]
Mark Chesney commented on MWAR-21:
----------------------------------
You're missing an important aspect of J2EE packaging. If a dependency is
included in the EAR to be used by J2EE modules within the same EAR, it must be
listed in the manifest of that module. To have these dependencies included in
the manfiest of the WAR using existing mechanisms, the WAR plugin must be
configured like like so:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
Provided scope dependencies will not be included in the WAR manifest. Compile
and Runtime scope dependencies will be added to the WAR manifest. The WAR
plugin also packages compile and runtime scope libraries in WEB-INF/lib. Not
only is this redundant, but it can cause Class Cast Exceptions. The J2EE spec
allows for any combination of WAR dependencies packaged in the EAR or within
WEB-INF/lib, not just one or the other. Please see the J2EE 1.4 specification
(http://java.sun.com/j2ee/j2ee-1_4-fr-spec.pdf) section 8.2, for valid J2EE
packaging use cases.
> Need a way to include limited set of webapp's dependencies
> ----------------------------------------------------------
>
> Key: MWAR-21
> URL: http://jira.codehaus.org/browse/MWAR-21
> Project: Maven 2.x War Plugin
> Type: Improvement
> Environment: M2.0.1
> Reporter: Dirk Olmes
> Assignee: John Tolentino
> Priority: Blocker
> Fix For: 2.0
> Attachments: AbstractWarMojo.diff
>
> Time Spent: 6 hours
> Remaining: 0 minutes
>
> I need a way to pack a war that includes only a limited set of the webapp's
> dependencies. We're deploying in mainly two different environments: for
> testing, the webapp runs standalone and thus needs to include all its
> dependencies in the war. For production we deploy the webapp into a JBoss
> server that has all the dependencies already installed.
> I've modified AbstractWarMojo in the following way: 1) allow to specify
> dependencyIncludes an dependencyExcludes (as lists) 2) upon building the war,
> each dependency is checked against the excludes and the includes and will be
> added to the war accordingly.
> While this patch may not be the best way to to it, it clearly shows my
> requirements.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira