[ http://jira.codehaus.org/browse/MWAR-9?page=comments#action_67056 ] 

Al Robertson commented on MWAR-9:
---------------------------------

Comment taken from on MWAR-21

Here is a structure that J2EE requires maven to support

ear
---jar1
---war ->manifest classpath:jar1
-------jar2

war depends on jar1 and jar2

Currently, you can specify to add a manifest classpath entry. This adds an 
entry for each dependency that is not "Provided", because provided means 
"provided by the container". (CORRECT)
In the above example, I can't configure maven to exclude jar1 from the 
war/WEB-INF/lib dir but include it in the classpath manifest.

It appears to me that we need another dependency attribute to accompany scope 
"Provided", say <providedByManifestClasspath>true</providedByManifestClasspath> 
or a <providedBy>CONTAINER|MF-CP</providedBy> etc.
In this solution, we wouldn't need the manifest->addClasspath plugin config. 
The war builder would only include the artifact in the war when the scope 
wasn't provided and the war archiver would know when to include the dependency 
in the manifest classpath.
You would still require the manifest classpath prefix config.

Does this make sense?
Is there a way to accomplish this already?

> WAR plugin should support minimal WARs for inclusion within an EAR
> ------------------------------------------------------------------
>
>          Key: MWAR-9
>          URL: http://jira.codehaus.org/browse/MWAR-9
>      Project: Maven 2.x War Plugin
>         Type: Improvement

>     Reporter: Mike Perham

>
>
> I noticed that when I build a WAR, I get a gigantic WEB-INF/lib with all my 
> deps.  This is fine for a default but maven should also support "skeleton" 
> WARs which will be packaged within an EAR.  We have EARs which package 3-4 
> WARs each and to have the deps duplicated within each WAR means we cannot 
> have shared data (since the classes are loaded within each WAR's classloader, 
> rather than by the parent EAR's classloader).  It also means 80MB EARs!  :-)
> It seems like two things need to happen:
> 1) Add a "skeleton" flag which prevents copying any dependencies to 
> WEB-INF/lib.
> 2) Instead generate a META-INF/MANIFEST.MF which has a Class-Path entry which 
> lists the relative locations of the dependencies within the parent EAR.
> Fabrice has basically the same idea written down here.  Starting with "- for 
> a War..." : 
> http://marc.theaimsgroup.com/?l=turbine-maven-user&m=112737860024530&w=2

-- 
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

Reply via email to