Re: How to exclude transitive dependencies from war?

2012-09-28 Thread Vincent Latombe
Hello,

I believe there is now a skinny war option in the ear plugin that could
help you to handle this case. I never used it so I cannot really tell you
more about it.

Another option would be to have 2 profiles to build your war. One with all
dependencies provided by the ear marked as provided, and another one with
the same dependencies with compile/runtime scope.

Again another option would be to exclude dependencies at package time (in
the war plugin configuration)

Hope this helps,

Vincent
Le 17 sept. 2012 21:10, David Hoffer dhoff...@gmail.com a écrit :

 I need to package a war so that it can be optionally included in a ear
 deployment, put I can't just mark the ear level dependencies as
 provided because I do need the full war doing development work and
 running GWT hosted mode.

 I've followed this link

 http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
 regarding how to set the dependency as optional, which seems like it
 might be the right solution, as I want the full war in the current
 project but when used as an ear dependency I want it to exclude a
 dependency (and all its transitive dependencies).

 However its not working that way...if I set the artifact via:

 dependency
 groupIdcom.foo/groupId
 artifactIdbar/artifactId
 scopecompile/scope
 optionaltrue/optional
 /dependency

 It removes just the artifact bar from the war but leaves in the war
 all it's transitive dependencies, which is not expected.  How can I
 also exclude it's transitive dependencies?  This point is key as the
 logic provided by the ear is significant and probably has 100 or more
 jars...no way to know what they all are and that can change too.

 -Dave

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: How to exclude transitive dependencies from war?

2012-09-28 Thread Mark Struberg
I have a similar configuration in my project. 

It is an EAR project with lots of WARs on their own. The goal was to provide a 
way to be able to debug/develop the WARs standalone e.g. via mvn tomcat7:run. 
In this situation you need all your dependencies (even platform JARs like 
openwebbeans, myfaces and openjpa) in your WEB-INF/lib folder. But those libs 
should not get packaged when building the final EAR.

I ended up with an own 'ear' profile with has war-excludes set:


profiles
    profile
    idear/id
    build
 plugins

    plugin
    groupIdorg.apache.maven.plugins/groupId
    artifactIdmaven-war-plugin/artifactId
    configuration
    packagingExcludes
    ${war.excludes}
    /packagingExcludes

the war.excludes properties is maintained in a central location. Please note 
that the war.excludes contains a list of file names and not packages. 

E.g. WEB-INF/lib/openwebbeans-*,WEB-INF/lib/myfaces-api-*, ...



LieGrue,
strub




 From: Vincent Latombe vincent.lato...@gmail.com
To: Maven Users List users@maven.apache.org 
Sent: Friday, September 28, 2012 6:27 PM
Subject: Re: How to exclude transitive dependencies from war?
 
Hello,

I believe there is now a skinny war option in the ear plugin that could
help you to handle this case. I never used it so I cannot really tell you
more about it.

Another option would be to have 2 profiles to build your war. One with all
dependencies provided by the ear marked as provided, and another one with
the same dependencies with compile/runtime scope.

Again another option would be to exclude dependencies at package time (in
the war plugin configuration)

Hope this helps,

Vincent
Le 17 sept. 2012 21:10, David Hoffer dhoff...@gmail.com a écrit :

 I need to package a war so that it can be optionally included in a ear
 deployment, put I can't just mark the ear level dependencies as
 provided because I do need the full war doing development work and
 running GWT hosted mode.

 I've followed this link

 http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
 regarding how to set the dependency as optional, which seems like it
 might be the right solution, as I want the full war in the current
 project but when used as an ear dependency I want it to exclude a
 dependency (and all its transitive dependencies).

 However its not working that way...if I set the artifact via:

 dependency
             groupIdcom.foo/groupId
             artifactIdbar/artifactId
             scopecompile/scope
             optionaltrue/optional
 /dependency

 It removes just the artifact bar from the war but leaves in the war
 all it's transitive dependencies, which is not expected.  How can I
 also exclude it's transitive dependencies?  This point is key as the
 logic provided by the ear is significant and probably has 100 or more
 jars...no way to know what they all are and that can change too.

 -Dave

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org