I don't think it's possible to do this automatically - that would require the 
war project to be aware that it was going to be included in the ear project. 
There is a way to do manually. See 
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html (or 
using the provided scope as you mention).
 
Justin

________________________________

From: David Weintraub [mailto:qazw...@gmail.com]
Sent: Wed 9/16/2009 6:17 PM
To: Maven Users List
Subject: War packaged in ear. How to exclude shared jars



We have multiple modules in this configuration:

<root>
    aim
        core
        web*
    war*
    aimwebservices*
    projects
        ear**
        adinventory
        base
            jar
            hibernate-har
            ui

*Builds a warfile and not a jar
** Builds the earfile that contains everything.


Our module aim/web is dependent upon aim/core and that is dependent upon
springframework:core. When we build, the aim.war file gets a copy of the
springframework:core jarfile. However, this file is also in the "ear"
project where an ear that contains all the jars and wars are packaged.

Our developers don't want the aim:web warfile to contain the
springframework:core jarfile since it is already in the overall earfile. We
know we can specifically mention the dependency on springframework:core,
then give its type as provided, but I am looking at an overall strategy: If
a warfile will contain a jarfile that is already in the ear, we don't want
it packaged in our warfile. Is that possible?


--
David Weintraub
qazw...@gmail.com


Reply via email to