You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Smiley <DS...@mitre.org> on 2006/07/21 19:47:09 UTC

Excluding jars from my ear

Hi. I have a multi-module project.  My parent pom specifies the dependencies
that are used by practically everything.  I have an ear module that's sole
purpose is to package up two war files (in other modules), but nothing else. 
It does this but includes jar's specified by my parent pom.  But I don't
want any of those at all... since they are included already in both war
files.  I want to keep the war files that  way because that makes them
independently complete.  I looked at the ear plugin page and I see a mention
of "excludes" but it doesn't seem to work.  I have it like so:
<excludes>*.jar</excludes>

What should I do?
-- 
View this message in context: http://www.nabble.com/Excluding-jars-from-my-ear-tf1981474.html#a5437741
Sent from the Maven - Users forum at Nabble.com.


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


Re: Excluding jars from my ear

Posted by David Smiley <DS...@mitre.org>.
Thanks Max.  I think I'll have it not inherit from the parent... that seems
like the most practical solution.

Still... it would be nice if the ear module had a way to specify that it by
default not pull in jars not mentioned explicitly in it's "modules"
configuration.

~ David
-- 
View this message in context: http://www.nabble.com/Excluding-jars-from-my-ear-tf1981474.html#a5466845
Sent from the Maven - Users forum at Nabble.com.


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


Re: Excluding jars from my ear

Posted by Max Cooper <ma...@maxcooper.com>.
David,

Your ear module should not inherit dependencies that it doesn't need.

One solution is to have your ear module NOT inherit from the parent pom.

Another solution is to use the <dependencyManagement> section in the 
parent pom, and then specify which dependencies each module *really* 
uses in their own poms. <dependencyManagement> allows you to control 
dependency versions (and scope, etc.) across your whole project, without 
forcing modules to inherit dependencies they don't need. It is sloppy to 
have modules inheriting dependencies that they don't need, and this 
strategy eliminates the slop.

A third solution is to have two levels of parent poms. One stripped-down 
super-parent, with no dependencies specified. The ear module will 
inherit directly from this super-parent. Then make your existing parent, 
the one with all the dependencies, also inherit from the super-parent. 
The other modules that really need the dependencies will inherit from 
the parent, rather than the super-parent.

-Max

David Smiley wrote:
> Hi. I have a multi-module project.  My parent pom specifies the dependencies
> that are used by practically everything.  I have an ear module that's sole
> purpose is to package up two war files (in other modules), but nothing else. 
> It does this but includes jar's specified by my parent pom.  But I don't
> want any of those at all... since they are included already in both war
> files.  I want to keep the war files that  way because that makes them
> independently complete.  I looked at the ear plugin page and I see a mention
> of "excludes" but it doesn't seem to work.  I have it like so:
> <excludes>*.jar</excludes>
> 
> What should I do?

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


Re: Excluding jars from my ear

Posted by David Smiley <DS...@mitre.org>.
Wouldn't doing so prevent me from using the Jetty plugin to test the webapp? 
Jetty wouldn't know to load the dependencies since it sees "provided".

Even if that wasn't an issue... I wonder about the total XML / config that
needs to be typed and synchronized between those files.  No thanks.

I just wish I could do some sort of excludes *.jar for the ear file... or if
the ear plugin had an option to not pull anything not explicitly mentioned
in a module in its config.  -- that seems best.

~ David
-- 
View this message in context: http://www.nabble.com/Excluding-jars-from-my-ear-tf1981474.html#a5440078
Sent from the Maven - Users forum at Nabble.com.


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


Re: Excluding jars from my ear

Posted by Wayne Fay <wa...@gmail.com>.
I would simply specify all the deps in EAR pom with
<scope>provided</scope>. This should prevent them from being copied
into the EAR lib.

And yes, you will need to sync the list etc. Its really not that painful imo.

Personally, I go the other route -- specify all deps in my WARs as
provided and specify them again in my EAR so they get pulled in.

Wayne

On 7/21/06, David Smiley <DS...@mitre.org> wrote:
>
> That didn't work Ian.  And even if it did... this solution would mean I need
> to keep this list in sync with my parent pom's dependencies.
>
> ~ David
> --
> View this message in context: http://www.nabble.com/Excluding-jars-from-my-ear-tf1981474.html#a5439615
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


RE: Excluding jars from my ear

Posted by David Smiley <DS...@mitre.org>.
That didn't work Ian.  And even if it did... this solution would mean I need
to keep this list in sync with my parent pom's dependencies.

~ David
-- 
View this message in context: http://www.nabble.com/Excluding-jars-from-my-ear-tf1981474.html#a5439615
Sent from the Maven - Users forum at Nabble.com.


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