You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amit kumar <am...@gmail.com> on 2008/01/08 13:43:16 UTC

How to avoid transitive Dependencies getting packaged

Hi,
I am building a WAR, but I see some jar files in the lib WEB-INF\lib folder
in the build which are not mentioned in the pom.xml, and probably are
transitive dependencies. How do I make sure the transitive dependencies are
not put in the lib folder.
I looked on maven-war-plugin FAQs but not any help.


Could someone please guide on that.

Regards,
Amit

Re: How to avoid transitive Dependencies getting packaged

Posted by amit kumar <am...@gmail.com>.
Yes Vishal thats very true, in fact even i am looking for a similar
solution.

On Jan 9, 2008 2:01 PM, Vishal Pahwa <vp...@sapient.com> wrote:

>
> Amit
>
> Thats pretty much fine but the problem is we have got plenty of
> dependencies and stopping them to get inside lib directory with this
> method is a bit cumbersome thats why i was lookin for some other
> efficient way if exists.
>
> Regards
>
> Vishal.
>
> -----Original Message-----
> From: amit kumar [mailto:amit.kumar97400@gmail.com]
> Sent: Wednesday, January 09, 2008 1:53 PM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> Vishal:
> you can use
> <dependency>
> <groupId>A</groupId>
> <artifactId>A</artifactId>
> <exclusions>
> <exclusion>
> <groupId></groupId>
> <artifactId><artifactId>
> </exclusion>
> <exclusions>
> </dependency>
> in exclusion you can specify the dependencies of A. As per my knowledge
> there would be one exclusion tag for each dependency.
> This is the only method I know by now.
>
>
> Nick: I am using Maven 2.0.7. And surprisingly I have used mvn site also
> to
> track the dependencies, but commons-logging-1.0.4 appears no where but
> straight in the WEB-INF folder. Not able to figure out where is it
> coming
> from.
>
> Regards,
> Amit
>
> On Jan 9, 2008 1:03 PM, Vishal Pahwa <vp...@sapient.com> wrote:
>
> >
> >
> > Hi
> >
> > I have also similar kind of problem and needs an effective solution.
> >
> > Problem: Let's say we have one custom module for creating jar file
> let's
> > the name of the jar file is A.jar and that module is dependent upon
> > let's say 10 third party jars.
> >
> > Now i have one module for creating war file and i need to add A.jar in
> > the lib directory of this war file, but i dont require theses 10 jars
> on
> > which A.jar is dependent so how can i resist these unwanted jars to
> pack
> > inside lib directory of the war file. The problem may not be exactly
> > same but yes the scenario is pretty much similar.
> >
> > So could anyone please tell me how to avoid these transitive
> > dependencies to get intrude in the lib directory of the war file.
> >
> > Regards
> >
> > Vishal.
> >
> > -----Original Message-----
> > From: amit kumar [mailto:amit.kumar97400@gmail.com]
> > Sent: Wednesday, January 09, 2008 12:46 PM
> > To: Maven Users List
> > Subject: Re: How to avoid transitive Dependencies getting packaged
> >
> > The one reason at the moment of not including the transitive
> > dependencies is
> > the redundant jar files in the lib folder of the packaged WAR.
> > For instance in the lib folder of the WAR i can see
> > commons-logging-1.0.4(transitive
> > dependency of something which I am not able to figure out even after
> > using
> > -X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
> > And
> > there were some more similar occurrences like that of two versions of
> > spring
> > hibernate etc.
> >
> > Regards,
> > Amit
> >
> > On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
> > wrote:
> >
> > > Why do you want to exclude the transitive dependencies?  Is it
> because
> > > these provided by your container (JBoss, Tomcat) and you wish to use
> > > those provided versions?  How do you verify that the container's
> > > versions are compatible?
> > >
> > > Richard Brewster
> > > Senior Associate
> > > Perrin Quarles Associates
> > > richardbrewster@pqa.com
> > > (434) 817-2640
> > >
> > >
> > > -----Original Message-----
> > > From: Wayne Fay [mailto:waynefay@gmail.com]
> > > Sent: Tuesday, January 08, 2008 9:51 AM
> > > To: Maven Users List
> > > Subject: Re: How to avoid transitive Dependencies getting packaged
> > >
> > > The way I do this (and there may be another or better way), I add
> > > explicitly add the transitive dependencies to my pom, and mark them
> as
> > > scope "provided".
> > >
> > > Wayne
> > >
> > > On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > > > Hi,
> > > > I am building a WAR, but I see some jar files in the lib
> WEB-INF\lib
> > > > folder in the build which are not mentioned in the pom.xml, and
> > > > probably are transitive dependencies. How do I make sure the
> > > > transitive dependencies are not put in the lib folder.
> > > > I looked on maven-war-plugin FAQs but not any help.
> > > >
> > > >
> > > > Could someone please guide on that.
> > > >
> > > > Regards,
> > > > Amit
> > > >
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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: How to avoid transitive Dependencies getting packaged

Posted by ni...@planet.nl.
If you want the jar file of module A working at runtime, how is that possible without the transitive libraries? Could you change the module to include those dependencies only at compile time? Then they won't be transitive at runtime.

With regards,

Nick Stolwijk


-----Original Message-----
From: Vishal Pahwa [mailto:vpahwa@sapient.com]
Sent: Wed 1/9/2008 9:31 AM
To: Maven Users List
Subject: RE: How to avoid transitive Dependencies getting packaged
 

Amit

Thats pretty much fine but the problem is we have got plenty of
dependencies and stopping them to get inside lib directory with this
method is a bit cumbersome thats why i was lookin for some other
efficient way if exists.

Regards

Vishal. 

-----Original Message-----
From: amit kumar [mailto:amit.kumar97400@gmail.com] 
Sent: Wednesday, January 09, 2008 1:53 PM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged

Vishal:
you can use
<dependency>
<groupId>A</groupId>
<artifactId>A</artifactId>
<exclusions>
<exclusion>
<groupId></groupId>
<artifactId><artifactId>
</exclusion>
<exclusions>
</dependency>
in exclusion you can specify the dependencies of A. As per my knowledge
there would be one exclusion tag for each dependency.
This is the only method I know by now.


Nick: I am using Maven 2.0.7. And surprisingly I have used mvn site also
to
track the dependencies, but commons-logging-1.0.4 appears no where but
straight in the WEB-INF folder. Not able to figure out where is it
coming
from.

Regards,
Amit

On Jan 9, 2008 1:03 PM, Vishal Pahwa <vp...@sapient.com> wrote:

>
>
> Hi
>
> I have also similar kind of problem and needs an effective solution.
>
> Problem: Let's say we have one custom module for creating jar file
let's
> the name of the jar file is A.jar and that module is dependent upon
> let's say 10 third party jars.
>
> Now i have one module for creating war file and i need to add A.jar in
> the lib directory of this war file, but i dont require theses 10 jars
on
> which A.jar is dependent so how can i resist these unwanted jars to
pack
> inside lib directory of the war file. The problem may not be exactly
> same but yes the scenario is pretty much similar.
>
> So could anyone please tell me how to avoid these transitive
> dependencies to get intrude in the lib directory of the war file.
>
> Regards
>
> Vishal.
>
> -----Original Message-----
> From: amit kumar [mailto:amit.kumar97400@gmail.com]
> Sent: Wednesday, January 09, 2008 12:46 PM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The one reason at the moment of not including the transitive
> dependencies is
> the redundant jar files in the lib folder of the packaged WAR.
> For instance in the lib folder of the WAR i can see
> commons-logging-1.0.4(transitive
> dependency of something which I am not able to figure out even after
> using
> -X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
> And
> there were some more similar occurrences like that of two versions of
> spring
> hibernate etc.
>
> Regards,
> Amit
>
> On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
> wrote:
>
> > Why do you want to exclude the transitive dependencies?  Is it
because
> > these provided by your container (JBoss, Tomcat) and you wish to use
> > those provided versions?  How do you verify that the container's
> > versions are compatible?
> >
> > Richard Brewster
> > Senior Associate
> > Perrin Quarles Associates
> > richardbrewster@pqa.com
> > (434) 817-2640
> >
> >
> > -----Original Message-----
> > From: Wayne Fay [mailto:waynefay@gmail.com]
> > Sent: Tuesday, January 08, 2008 9:51 AM
> > To: Maven Users List
> > Subject: Re: How to avoid transitive Dependencies getting packaged
> >
> > The way I do this (and there may be another or better way), I add
> > explicitly add the transitive dependencies to my pom, and mark them
as
> > scope "provided".
> >
> > Wayne
> >
> > On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > > Hi,
> > > I am building a WAR, but I see some jar files in the lib
WEB-INF\lib
> > > folder in the build which are not mentioned in the pom.xml, and
> > > probably are transitive dependencies. How do I make sure the
> > > transitive dependencies are not put in the lib folder.
> > > I looked on maven-war-plugin FAQs but not any help.
> > >
> > >
> > > Could someone please guide on that.
> > >
> > > Regards,
> > > Amit
> > >
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: How to avoid transitive Dependencies getting packaged

Posted by Vishal Pahwa <vp...@sapient.com>.
Amit

Thats pretty much fine but the problem is we have got plenty of
dependencies and stopping them to get inside lib directory with this
method is a bit cumbersome thats why i was lookin for some other
efficient way if exists.

Regards

Vishal. 

-----Original Message-----
From: amit kumar [mailto:amit.kumar97400@gmail.com] 
Sent: Wednesday, January 09, 2008 1:53 PM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged

Vishal:
you can use
<dependency>
<groupId>A</groupId>
<artifactId>A</artifactId>
<exclusions>
<exclusion>
<groupId></groupId>
<artifactId><artifactId>
</exclusion>
<exclusions>
</dependency>
in exclusion you can specify the dependencies of A. As per my knowledge
there would be one exclusion tag for each dependency.
This is the only method I know by now.


Nick: I am using Maven 2.0.7. And surprisingly I have used mvn site also
to
track the dependencies, but commons-logging-1.0.4 appears no where but
straight in the WEB-INF folder. Not able to figure out where is it
coming
from.

Regards,
Amit

On Jan 9, 2008 1:03 PM, Vishal Pahwa <vp...@sapient.com> wrote:

>
>
> Hi
>
> I have also similar kind of problem and needs an effective solution.
>
> Problem: Let's say we have one custom module for creating jar file
let's
> the name of the jar file is A.jar and that module is dependent upon
> let's say 10 third party jars.
>
> Now i have one module for creating war file and i need to add A.jar in
> the lib directory of this war file, but i dont require theses 10 jars
on
> which A.jar is dependent so how can i resist these unwanted jars to
pack
> inside lib directory of the war file. The problem may not be exactly
> same but yes the scenario is pretty much similar.
>
> So could anyone please tell me how to avoid these transitive
> dependencies to get intrude in the lib directory of the war file.
>
> Regards
>
> Vishal.
>
> -----Original Message-----
> From: amit kumar [mailto:amit.kumar97400@gmail.com]
> Sent: Wednesday, January 09, 2008 12:46 PM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The one reason at the moment of not including the transitive
> dependencies is
> the redundant jar files in the lib folder of the packaged WAR.
> For instance in the lib folder of the WAR i can see
> commons-logging-1.0.4(transitive
> dependency of something which I am not able to figure out even after
> using
> -X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
> And
> there were some more similar occurrences like that of two versions of
> spring
> hibernate etc.
>
> Regards,
> Amit
>
> On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
> wrote:
>
> > Why do you want to exclude the transitive dependencies?  Is it
because
> > these provided by your container (JBoss, Tomcat) and you wish to use
> > those provided versions?  How do you verify that the container's
> > versions are compatible?
> >
> > Richard Brewster
> > Senior Associate
> > Perrin Quarles Associates
> > richardbrewster@pqa.com
> > (434) 817-2640
> >
> >
> > -----Original Message-----
> > From: Wayne Fay [mailto:waynefay@gmail.com]
> > Sent: Tuesday, January 08, 2008 9:51 AM
> > To: Maven Users List
> > Subject: Re: How to avoid transitive Dependencies getting packaged
> >
> > The way I do this (and there may be another or better way), I add
> > explicitly add the transitive dependencies to my pom, and mark them
as
> > scope "provided".
> >
> > Wayne
> >
> > On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > > Hi,
> > > I am building a WAR, but I see some jar files in the lib
WEB-INF\lib
> > > folder in the build which are not mentioned in the pom.xml, and
> > > probably are transitive dependencies. How do I make sure the
> > > transitive dependencies are not put in the lib folder.
> > > I looked on maven-war-plugin FAQs but not any help.
> > >
> > >
> > > Could someone please guide on that.
> > >
> > > Regards,
> > > Amit
> > >
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: How to avoid transitive Dependencies getting packaged

Posted by ni...@planet.nl.
Amit,

Could you send me the output of mvn clean install -X (pipe it to a file) privately. I can have a look at it and reply here hopefully the solution.

With regards,

Nick Stolwijk


-----Original Message-----
From: amit kumar [mailto:amit.kumar97400@gmail.com]
Sent: Wed 1/9/2008 9:23 AM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged
 
Vishal:
you can use
<dependency>
<groupId>A</groupId>
<artifactId>A</artifactId>
<exclusions>
<exclusion>
<groupId></groupId>
<artifactId><artifactId>
</exclusion>
<exclusions>
</dependency>
in exclusion you can specify the dependencies of A. As per my knowledge
there would be one exclusion tag for each dependency.
This is the only method I know by now.


Nick: I am using Maven 2.0.7. And surprisingly I have used mvn site also to
track the dependencies, but commons-logging-1.0.4 appears no where but
straight in the WEB-INF folder. Not able to figure out where is it coming
from.

Regards,
Amit

On Jan 9, 2008 1:03 PM, Vishal Pahwa <vp...@sapient.com> wrote:

>
>
> Hi
>
> I have also similar kind of problem and needs an effective solution.
>
> Problem: Let's say we have one custom module for creating jar file let's
> the name of the jar file is A.jar and that module is dependent upon
> let's say 10 third party jars.
>
> Now i have one module for creating war file and i need to add A.jar in
> the lib directory of this war file, but i dont require theses 10 jars on
> which A.jar is dependent so how can i resist these unwanted jars to pack
> inside lib directory of the war file. The problem may not be exactly
> same but yes the scenario is pretty much similar.
>
> So could anyone please tell me how to avoid these transitive
> dependencies to get intrude in the lib directory of the war file.
>
> Regards
>
> Vishal.
>
> -----Original Message-----
> From: amit kumar [mailto:amit.kumar97400@gmail.com]
> Sent: Wednesday, January 09, 2008 12:46 PM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The one reason at the moment of not including the transitive
> dependencies is
> the redundant jar files in the lib folder of the packaged WAR.
> For instance in the lib folder of the WAR i can see
> commons-logging-1.0.4(transitive
> dependency of something which I am not able to figure out even after
> using
> -X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
> And
> there were some more similar occurrences like that of two versions of
> spring
> hibernate etc.
>
> Regards,
> Amit
>
> On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
> wrote:
>
> > Why do you want to exclude the transitive dependencies?  Is it because
> > these provided by your container (JBoss, Tomcat) and you wish to use
> > those provided versions?  How do you verify that the container's
> > versions are compatible?
> >
> > Richard Brewster
> > Senior Associate
> > Perrin Quarles Associates
> > richardbrewster@pqa.com
> > (434) 817-2640
> >
> >
> > -----Original Message-----
> > From: Wayne Fay [mailto:waynefay@gmail.com]
> > Sent: Tuesday, January 08, 2008 9:51 AM
> > To: Maven Users List
> > Subject: Re: How to avoid transitive Dependencies getting packaged
> >
> > The way I do this (and there may be another or better way), I add
> > explicitly add the transitive dependencies to my pom, and mark them as
> > scope "provided".
> >
> > Wayne
> >
> > On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > > Hi,
> > > I am building a WAR, but I see some jar files in the lib WEB-INF\lib
> > > folder in the build which are not mentioned in the pom.xml, and
> > > probably are transitive dependencies. How do I make sure the
> > > transitive dependencies are not put in the lib folder.
> > > I looked on maven-war-plugin FAQs but not any help.
> > >
> > >
> > > Could someone please guide on that.
> > >
> > > Regards,
> > > Amit
> > >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


Re: How to avoid transitive Dependencies getting packaged

Posted by amit kumar <am...@gmail.com>.
Vishal:
you can use
<dependency>
<groupId>A</groupId>
<artifactId>A</artifactId>
<exclusions>
<exclusion>
<groupId></groupId>
<artifactId><artifactId>
</exclusion>
<exclusions>
</dependency>
in exclusion you can specify the dependencies of A. As per my knowledge
there would be one exclusion tag for each dependency.
This is the only method I know by now.


Nick: I am using Maven 2.0.7. And surprisingly I have used mvn site also to
track the dependencies, but commons-logging-1.0.4 appears no where but
straight in the WEB-INF folder. Not able to figure out where is it coming
from.

Regards,
Amit

On Jan 9, 2008 1:03 PM, Vishal Pahwa <vp...@sapient.com> wrote:

>
>
> Hi
>
> I have also similar kind of problem and needs an effective solution.
>
> Problem: Let's say we have one custom module for creating jar file let's
> the name of the jar file is A.jar and that module is dependent upon
> let's say 10 third party jars.
>
> Now i have one module for creating war file and i need to add A.jar in
> the lib directory of this war file, but i dont require theses 10 jars on
> which A.jar is dependent so how can i resist these unwanted jars to pack
> inside lib directory of the war file. The problem may not be exactly
> same but yes the scenario is pretty much similar.
>
> So could anyone please tell me how to avoid these transitive
> dependencies to get intrude in the lib directory of the war file.
>
> Regards
>
> Vishal.
>
> -----Original Message-----
> From: amit kumar [mailto:amit.kumar97400@gmail.com]
> Sent: Wednesday, January 09, 2008 12:46 PM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The one reason at the moment of not including the transitive
> dependencies is
> the redundant jar files in the lib folder of the packaged WAR.
> For instance in the lib folder of the WAR i can see
> commons-logging-1.0.4(transitive
> dependency of something which I am not able to figure out even after
> using
> -X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
> And
> there were some more similar occurrences like that of two versions of
> spring
> hibernate etc.
>
> Regards,
> Amit
>
> On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
> wrote:
>
> > Why do you want to exclude the transitive dependencies?  Is it because
> > these provided by your container (JBoss, Tomcat) and you wish to use
> > those provided versions?  How do you verify that the container's
> > versions are compatible?
> >
> > Richard Brewster
> > Senior Associate
> > Perrin Quarles Associates
> > richardbrewster@pqa.com
> > (434) 817-2640
> >
> >
> > -----Original Message-----
> > From: Wayne Fay [mailto:waynefay@gmail.com]
> > Sent: Tuesday, January 08, 2008 9:51 AM
> > To: Maven Users List
> > Subject: Re: How to avoid transitive Dependencies getting packaged
> >
> > The way I do this (and there may be another or better way), I add
> > explicitly add the transitive dependencies to my pom, and mark them as
> > scope "provided".
> >
> > Wayne
> >
> > On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > > Hi,
> > > I am building a WAR, but I see some jar files in the lib WEB-INF\lib
> > > folder in the build which are not mentioned in the pom.xml, and
> > > probably are transitive dependencies. How do I make sure the
> > > transitive dependencies are not put in the lib folder.
> > > I looked on maven-war-plugin FAQs but not any help.
> > >
> > >
> > > Could someone please guide on that.
> > >
> > > Regards,
> > > Amit
> > >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: How to avoid transitive Dependencies getting packaged

Posted by Vishal Pahwa <vp...@sapient.com>.

Hi

I have also similar kind of problem and needs an effective solution. 

Problem: Let's say we have one custom module for creating jar file let's
the name of the jar file is A.jar and that module is dependent upon
let's say 10 third party jars.

Now i have one module for creating war file and i need to add A.jar in
the lib directory of this war file, but i dont require theses 10 jars on
which A.jar is dependent so how can i resist these unwanted jars to pack
inside lib directory of the war file. The problem may not be exactly
same but yes the scenario is pretty much similar.

So could anyone please tell me how to avoid these transitive
dependencies to get intrude in the lib directory of the war file.

Regards

Vishal. 

-----Original Message-----
From: amit kumar [mailto:amit.kumar97400@gmail.com] 
Sent: Wednesday, January 09, 2008 12:46 PM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged

The one reason at the moment of not including the transitive
dependencies is
the redundant jar files in the lib folder of the packaged WAR.
For instance in the lib folder of the WAR i can see
commons-logging-1.0.4(transitive
dependency of something which I am not able to figure out even after
using
-X with maven goal) and commons-logging-1.1(explicit in the pom.xml).
And
there were some more similar occurrences like that of two versions of
spring
hibernate etc.

Regards,
Amit

On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com>
wrote:

> Why do you want to exclude the transitive dependencies?  Is it because
> these provided by your container (JBoss, Tomcat) and you wish to use
> those provided versions?  How do you verify that the container's
> versions are compatible?
>
> Richard Brewster
> Senior Associate
> Perrin Quarles Associates
> richardbrewster@pqa.com
> (434) 817-2640
>
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Tuesday, January 08, 2008 9:51 AM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The way I do this (and there may be another or better way), I add
> explicitly add the transitive dependencies to my pom, and mark them as
> scope "provided".
>
> Wayne
>
> On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > Hi,
> > I am building a WAR, but I see some jar files in the lib WEB-INF\lib
> > folder in the build which are not mentioned in the pom.xml, and
> > probably are transitive dependencies. How do I make sure the
> > transitive dependencies are not put in the lib folder.
> > I looked on maven-war-plugin FAQs but not any help.
> >
> >
> > Could someone please guide on that.
> >
> > Regards,
> > Amit
> >
>
> ---------------------------------------------------------------------
> 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
>
>

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


RE: How to avoid transitive Dependencies getting packaged

Posted by ni...@planet.nl.
Which maven version are you using? There were a few problems like this in 2.0.4 and 2.05 IIRC.

Hth,

Nick Stolwijk


-----Original Message-----
From: amit kumar [mailto:amit.kumar97400@gmail.com]
Sent: Wed 1/9/2008 8:16 AM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged
 
The one reason at the moment of not including the transitive dependencies is
the redundant jar files in the lib folder of the packaged WAR.
For instance in the lib folder of the WAR i can see
commons-logging-1.0.4(transitive
dependency of something which I am not able to figure out even after using
-X with maven goal) and commons-logging-1.1(explicit in the pom.xml). And
there were some more similar occurrences like that of two versions of spring
hibernate etc.

Regards,
Amit

On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com> wrote:

> Why do you want to exclude the transitive dependencies?  Is it because
> these provided by your container (JBoss, Tomcat) and you wish to use
> those provided versions?  How do you verify that the container's
> versions are compatible?
>
> Richard Brewster
> Senior Associate
> Perrin Quarles Associates
> richardbrewster@pqa.com
> (434) 817-2640
>
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Tuesday, January 08, 2008 9:51 AM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The way I do this (and there may be another or better way), I add
> explicitly add the transitive dependencies to my pom, and mark them as
> scope "provided".
>
> Wayne
>
> On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > Hi,
> > I am building a WAR, but I see some jar files in the lib WEB-INF\lib
> > folder in the build which are not mentioned in the pom.xml, and
> > probably are transitive dependencies. How do I make sure the
> > transitive dependencies are not put in the lib folder.
> > I looked on maven-war-plugin FAQs but not any help.
> >
> >
> > Could someone please guide on that.
> >
> > Regards,
> > Amit
> >
>
> ---------------------------------------------------------------------
> 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: How to avoid transitive Dependencies getting packaged

Posted by amit kumar <am...@gmail.com>.
The one reason at the moment of not including the transitive dependencies is
the redundant jar files in the lib folder of the packaged WAR.
For instance in the lib folder of the WAR i can see
commons-logging-1.0.4(transitive
dependency of something which I am not able to figure out even after using
-X with maven goal) and commons-logging-1.1(explicit in the pom.xml). And
there were some more similar occurrences like that of two versions of spring
hibernate etc.

Regards,
Amit

On Jan 9, 2008 3:07 AM, Brewster, Richard <ri...@pqa.com> wrote:

> Why do you want to exclude the transitive dependencies?  Is it because
> these provided by your container (JBoss, Tomcat) and you wish to use
> those provided versions?  How do you verify that the container's
> versions are compatible?
>
> Richard Brewster
> Senior Associate
> Perrin Quarles Associates
> richardbrewster@pqa.com
> (434) 817-2640
>
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Tuesday, January 08, 2008 9:51 AM
> To: Maven Users List
> Subject: Re: How to avoid transitive Dependencies getting packaged
>
> The way I do this (and there may be another or better way), I add
> explicitly add the transitive dependencies to my pom, and mark them as
> scope "provided".
>
> Wayne
>
> On 1/8/08, amit kumar <am...@gmail.com> wrote:
> > Hi,
> > I am building a WAR, but I see some jar files in the lib WEB-INF\lib
> > folder in the build which are not mentioned in the pom.xml, and
> > probably are transitive dependencies. How do I make sure the
> > transitive dependencies are not put in the lib folder.
> > I looked on maven-war-plugin FAQs but not any help.
> >
> >
> > Could someone please guide on that.
> >
> > Regards,
> > Amit
> >
>
> ---------------------------------------------------------------------
> 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: How to avoid transitive Dependencies getting packaged

Posted by "Brewster, Richard" <ri...@pqa.com>.
Why do you want to exclude the transitive dependencies?  Is it because
these provided by your container (JBoss, Tomcat) and you wish to use
those provided versions?  How do you verify that the container's
versions are compatible?

Richard Brewster
Senior Associate
Perrin Quarles Associates
richardbrewster@pqa.com
(434) 817-2640


-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, January 08, 2008 9:51 AM
To: Maven Users List
Subject: Re: How to avoid transitive Dependencies getting packaged

The way I do this (and there may be another or better way), I add
explicitly add the transitive dependencies to my pom, and mark them as
scope "provided".

Wayne

On 1/8/08, amit kumar <am...@gmail.com> wrote:
> Hi,
> I am building a WAR, but I see some jar files in the lib WEB-INF\lib 
> folder in the build which are not mentioned in the pom.xml, and 
> probably are transitive dependencies. How do I make sure the 
> transitive dependencies are not put in the lib folder.
> I looked on maven-war-plugin FAQs but not any help.
>
>
> Could someone please guide on that.
>
> Regards,
> Amit
>

---------------------------------------------------------------------
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: How to avoid transitive Dependencies getting packaged

Posted by Wayne Fay <wa...@gmail.com>.
The way I do this (and there may be another or better way), I add
explicitly add the transitive dependencies to my pom, and mark them as
scope "provided".

Wayne

On 1/8/08, amit kumar <am...@gmail.com> wrote:
> Hi,
> I am building a WAR, but I see some jar files in the lib WEB-INF\lib folder
> in the build which are not mentioned in the pom.xml, and probably are
> transitive dependencies. How do I make sure the transitive dependencies are
> not put in the lib folder.
> I looked on maven-war-plugin FAQs but not any help.
>
>
> Could someone please guide on that.
>
> Regards,
> Amit
>

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