You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by AVSUNIL <su...@infosys.com> on 2010/05/18 14:42:03 UTC

Is there a way to disable transitive dependencies?

Hi,

I have project A which produces artifact as war. Project A has dependency on
project B and it is mentioned in the pom of Project A. Now the build of
Project A is acting indifferently in 2 environments

a) When I am building from my local/development envionment, it builds the
war with only the dependencies mentioned in its pom

b) When I build from my test environment, it builds the war with dependecies
mentioned in pom as well as dependecies of dependecies. This is undesirable
as war will become very big as well as unwanted versions might cree through

How do I get the behaviour of my dev env in test env also? How do I make
sure dependecies of dependencies does not come inot my war?
> I am only using pom and and not the assembly descriptor.
> Both environment have the same build script which checksout the latest
> from SVN and then does
mvn clean
mvn compile
mvn package

Thanks
Sunil

-- 
View this message in context: http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28595375.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is there a way to disable transitive dependencies?

Posted by Andrew Close <ac...@gmail.com>.
On Tue, May 18, 2010 at 8:44 AM, AVSUNIL <su...@infosys.com> wrote:
>
> It is the same maven version. mvn -v gives 2.2.0 in both environments. It is
> the same pom and same proxy and remote repositories also. Still the build
> war in one environment has transitive dependency jars in it. Any ideas?

are your dev environment and test environment both the same platform?
(windows, linux, OS X)
we've noticed that we get a different mix of transients when building
on differing platforms (windows vs. linux) even through we're using
the exact same maven install/settings/repos.


-- 
Andrew Close

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


Re: Is there a way to disable transitive dependencies?

Posted by AVSUNIL <su...@infosys.com>.
It is the same maven version. mvn -v gives 2.2.0 in both environments. It is
the same pom and same proxy and remote repositories also. Still the build
war in one environment has transitive dependency jars in it. Any ideas?

Thanks
Sunil
-- 
View this message in context: http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28596142.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is there a way to disable transitive dependencies?

Posted by Nick Stolwijk <ni...@gmail.com>.
Are you sure you have the same maven version on both environments? And
are you specifying all plugin versions?

It is a best practice to specify the versions of all plugins you use.
Different maven versions take different plugin versions. Use the
enforcer plugin to enforce that you specify all plugin versions.

With regards,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl



On Tue, May 18, 2010 at 2:42 PM, AVSUNIL <su...@infosys.com> wrote:
>
> Hi,
>
> I have project A which produces artifact as war. Project A has dependency on
> project B and it is mentioned in the pom of Project A. Now the build of
> Project A is acting indifferently in 2 environments
>
> a) When I am building from my local/development envionment, it builds the
> war with only the dependencies mentioned in its pom
>
> b) When I build from my test environment, it builds the war with dependecies
> mentioned in pom as well as dependecies of dependecies. This is undesirable
> as war will become very big as well as unwanted versions might cree through
>
> How do I get the behaviour of my dev env in test env also? How do I make
> sure dependecies of dependencies does not come inot my war?
>> I am only using pom and and not the assembly descriptor.
>> Both environment have the same build script which checksout the latest
>> from SVN and then does
> mvn clean
> mvn compile
> mvn package
>
> Thanks
> Sunil
>
> --
> View this message in context: http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28595375.html
> Sent from the Maven - Users mailing list archive 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: Is there a way to disable transitive dependencies?

Posted by Anders Hammar <an...@hammar.net>.
I just want to point out that there is not need to first call mvn compile
and then mvn package. mvn package is sufficient as it includes all phases up
to, and including, package.

/Anders

On Tue, May 18, 2010 at 14:42, AVSUNIL <su...@infosys.com> wrote:

>
> Hi,
>
> I have project A which produces artifact as war. Project A has dependency
> on
> project B and it is mentioned in the pom of Project A. Now the build of
> Project A is acting indifferently in 2 environments
>
> a) When I am building from my local/development envionment, it builds the
> war with only the dependencies mentioned in its pom
>
> b) When I build from my test environment, it builds the war with
> dependecies
> mentioned in pom as well as dependecies of dependecies. This is undesirable
> as war will become very big as well as unwanted versions might cree through
>
> How do I get the behaviour of my dev env in test env also? How do I make
> sure dependecies of dependencies does not come inot my war?
> > I am only using pom and and not the assembly descriptor.
> > Both environment have the same build script which checksout the latest
> > from SVN and then does
> mvn clean
> mvn compile
> mvn package
>
> Thanks
> Sunil
>
> --
> View this message in context:
> http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28595375.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Is there a way to disable transitive dependencies?

Posted by AVSUNIL <su...@infosys.com>.
Hi all,

Somehow I fixed this after manual comparision of every maven files between
the 2 environments. The environment where this problem was present, had
incorrect settings.xml.
The mirrorID was incorrectly mentioned same as server repository id. I
changed to proxy repository id and it started working fine. 

Thanks
Sunil


chetan mehrotra wrote:
> 
> There is a bug logged for it. Vote for it at
> http://jira.codehaus.org/browse/MNG-2315
> Chetan Mehrotra
> 
> 
> On Tue, May 18, 2010 at 7:48 PM, AVSUNIL <su...@infosys.com> wrote:
> 
>>
>> Hi Ron,
>>
>> I want to do something similar.. but I want to tell maven to exclude all
>> dependencies instead of listing 9 to 11 inside it. Is there a way?
>>
>> <dependency>
>> <groupId>group_of_needed_dependecny</groupId>
>> <artifactId>needed_dependecny</artifactId>
>> <version>1.8.1</version>
>> <exclusions>
>> <exclusion>
>> <artifactId>ALL??</artifactId>
>> <groupId>ALL??</groupId>
>> </exclusion>
>> <exclusion>
>> </dependency>
>>
>> Thanks
>> Sunil
>>
>>
>> ronatartifact wrote:
>> >
>> >
>> > You can use exclusions to cut out transitive dependencies.
>> >
>> > In the following example, we want our lms-facades package but we do not
>> > want the faces and logging dragged in with it.
>> >
>> > <dependency>
>> > <groupId>com.artifact_software.lms</groupId>
>> > <artifactId>lms-facades</artifactId>
>> > <version>1.8.1</version>
>> > <exclusions>
>> > <exclusion>
>> > <artifactId>jsf-api</artifactId>
>> > <groupId>javax.faces</groupId>
>> > </exclusion>
>> > <exclusion>
>> > <artifactId>jsf-impl</artifactId>
>> > <groupId>javax.faces</groupId>
>> > </exclusion>
>> > <exclusion>
>> > <artifactId>commons-logging</artifactId>
>> > <groupId>commons-logging</groupId>
>> > </exclusion>
>> > </exclusions>
>> > </dependency>
>> >
>> >
>> > Ron
>> >
>> > On 18/05/2010 8:42 AM, AVSUNIL wrote:
>> >> Hi,
>> >>
>> >> I have project A which produces artifact as war. Project A has
>> dependency
>> >> on
>> >> project B and it is mentioned in the pom of Project A. Now the build
>> of
>> >> Project A is acting indifferently in 2 environments
>> >>
>> >> a) When I am building from my local/development envionment, it builds
>> the
>> >> war with only the dependencies mentioned in its pom
>> >>
>> >> b) When I build from my test environment, it builds the war with
>> >> dependecies
>> >> mentioned in pom as well as dependecies of dependecies. This is
>> >> undesirable
>> >> as war will become very big as well as unwanted versions might cree
>> >> through
>> >>
>> >> How do I get the behaviour of my dev env in test env also? How do I
>> make
>> >> sure dependecies of dependencies does not come inot my war?
>> >>
>> >>> I am only using pom and and not the assembly descriptor.
>> >>> Both environment have the same build script which checksout the
>> latest
>> >>> from SVN and then does
>> >>>
>> >> mvn clean
>> >> mvn compile
>> >> mvn package
>> >>
>> >> Thanks
>> >> Sunil
>> >>
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28596595.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28629892.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is there a way to disable transitive dependencies?

Posted by chetan mehrotra <ch...@gmail.com>.
There is a bug logged for it. Vote for it at
http://jira.codehaus.org/browse/MNG-2315
Chetan Mehrotra


On Tue, May 18, 2010 at 7:48 PM, AVSUNIL <su...@infosys.com> wrote:

>
> Hi Ron,
>
> I want to do something similar.. but I want to tell maven to exclude all
> dependencies instead of listing 9 to 11 inside it. Is there a way?
>
> <dependency>
> <groupId>group_of_needed_dependecny</groupId>
> <artifactId>needed_dependecny</artifactId>
> <version>1.8.1</version>
> <exclusions>
> <exclusion>
> <artifactId>ALL??</artifactId>
> <groupId>ALL??</groupId>
> </exclusion>
> <exclusion>
> </dependency>
>
> Thanks
> Sunil
>
>
> ronatartifact wrote:
> >
> >
> > You can use exclusions to cut out transitive dependencies.
> >
> > In the following example, we want our lms-facades package but we do not
> > want the faces and logging dragged in with it.
> >
> > <dependency>
> > <groupId>com.artifact_software.lms</groupId>
> > <artifactId>lms-facades</artifactId>
> > <version>1.8.1</version>
> > <exclusions>
> > <exclusion>
> > <artifactId>jsf-api</artifactId>
> > <groupId>javax.faces</groupId>
> > </exclusion>
> > <exclusion>
> > <artifactId>jsf-impl</artifactId>
> > <groupId>javax.faces</groupId>
> > </exclusion>
> > <exclusion>
> > <artifactId>commons-logging</artifactId>
> > <groupId>commons-logging</groupId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> >
> >
> > Ron
> >
> > On 18/05/2010 8:42 AM, AVSUNIL wrote:
> >> Hi,
> >>
> >> I have project A which produces artifact as war. Project A has
> dependency
> >> on
> >> project B and it is mentioned in the pom of Project A. Now the build of
> >> Project A is acting indifferently in 2 environments
> >>
> >> a) When I am building from my local/development envionment, it builds
> the
> >> war with only the dependencies mentioned in its pom
> >>
> >> b) When I build from my test environment, it builds the war with
> >> dependecies
> >> mentioned in pom as well as dependecies of dependecies. This is
> >> undesirable
> >> as war will become very big as well as unwanted versions might cree
> >> through
> >>
> >> How do I get the behaviour of my dev env in test env also? How do I make
> >> sure dependecies of dependencies does not come inot my war?
> >>
> >>> I am only using pom and and not the assembly descriptor.
> >>> Both environment have the same build script which checksout the latest
> >>> from SVN and then does
> >>>
> >> mvn clean
> >> mvn compile
> >> mvn package
> >>
> >> Thanks
> >> Sunil
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28596595.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Is there a way to disable transitive dependencies?

Posted by AVSUNIL <su...@infosys.com>.
Hi Ron,

I want to do something similar.. but I want to tell maven to exclude all
dependencies instead of listing 9 to 11 inside it. Is there a way?

<dependency>
<groupId>group_of_needed_dependecny</groupId>
<artifactId>needed_dependecny</artifactId>
<version>1.8.1</version>
<exclusions>
<exclusion>
<artifactId>ALL??</artifactId>
<groupId>ALL??</groupId>
</exclusion>
<exclusion>
</dependency>

Thanks
Sunil


ronatartifact wrote:
> 
> 
> You can use exclusions to cut out transitive dependencies.
> 
> In the following example, we want our lms-facades package but we do not 
> want the faces and logging dragged in with it.
> 
> <dependency>
> <groupId>com.artifact_software.lms</groupId>
> <artifactId>lms-facades</artifactId>
> <version>1.8.1</version>
> <exclusions>
> <exclusion>
> <artifactId>jsf-api</artifactId>
> <groupId>javax.faces</groupId>
> </exclusion>
> <exclusion>
> <artifactId>jsf-impl</artifactId>
> <groupId>javax.faces</groupId>
> </exclusion>
> <exclusion>
> <artifactId>commons-logging</artifactId>
> <groupId>commons-logging</groupId>
> </exclusion>
> </exclusions>
> </dependency>
> 
> 
> Ron
> 
> On 18/05/2010 8:42 AM, AVSUNIL wrote:
>> Hi,
>>
>> I have project A which produces artifact as war. Project A has dependency
>> on
>> project B and it is mentioned in the pom of Project A. Now the build of
>> Project A is acting indifferently in 2 environments
>>
>> a) When I am building from my local/development envionment, it builds the
>> war with only the dependencies mentioned in its pom
>>
>> b) When I build from my test environment, it builds the war with
>> dependecies
>> mentioned in pom as well as dependecies of dependecies. This is
>> undesirable
>> as war will become very big as well as unwanted versions might cree
>> through
>>
>> How do I get the behaviour of my dev env in test env also? How do I make
>> sure dependecies of dependencies does not come inot my war?
>>    
>>> I am only using pom and and not the assembly descriptor.
>>> Both environment have the same build script which checksout the latest
>>> from SVN and then does
>>>      
>> mvn clean
>> mvn compile
>> mvn package
>>
>> Thanks
>> Sunil
>>
>>    
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28596595.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Is there a way to disable transitive dependencies?

Posted by Ron Wheeler <rw...@artifact-software.com>.
You can use exclusions to cut out transitive dependencies.

In the following example, we want our lms-facades package but we do not 
want the faces and logging dragged in with it.

<dependency>
<groupId>com.artifact_software.lms</groupId>
<artifactId>lms-facades</artifactId>
<version>1.8.1</version>
<exclusions>
<exclusion>
<artifactId>jsf-api</artifactId>
<groupId>javax.faces</groupId>
</exclusion>
<exclusion>
<artifactId>jsf-impl</artifactId>
<groupId>javax.faces</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>


Ron

On 18/05/2010 8:42 AM, AVSUNIL wrote:
> Hi,
>
> I have project A which produces artifact as war. Project A has dependency on
> project B and it is mentioned in the pom of Project A. Now the build of
> Project A is acting indifferently in 2 environments
>
> a) When I am building from my local/development envionment, it builds the
> war with only the dependencies mentioned in its pom
>
> b) When I build from my test environment, it builds the war with dependecies
> mentioned in pom as well as dependecies of dependecies. This is undesirable
> as war will become very big as well as unwanted versions might cree through
>
> How do I get the behaviour of my dev env in test env also? How do I make
> sure dependecies of dependencies does not come inot my war?
>    
>> I am only using pom and and not the assembly descriptor.
>> Both environment have the same build script which checksout the latest
>> from SVN and then does
>>      
> mvn clean
> mvn compile
> mvn package
>
> Thanks
> Sunil
>
>    


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


Re: Is there a way to disable transitive dependencies?

Posted by Morten Kjetland <mb...@kjetland.com>.
Hi,

If you decide to include the transient dependencies, a plugin called
deptools can help you detect when wrong dependency-versions are chosen.

You can have a look at it here:
http://github.com/mbknor/deptools

<http://github.com/mbknor/deptools>Regards,
Morten

On Tue, May 18, 2010 at 2:42 PM, AVSUNIL <su...@infosys.com> wrote:

>
> Hi,
>
> I have project A which produces artifact as war. Project A has dependency
> on
> project B and it is mentioned in the pom of Project A. Now the build of
> Project A is acting indifferently in 2 environments
>
> a) When I am building from my local/development envionment, it builds the
> war with only the dependencies mentioned in its pom
>
> b) When I build from my test environment, it builds the war with
> dependecies
> mentioned in pom as well as dependecies of dependecies. This is undesirable
> as war will become very big as well as unwanted versions might cree through
>
> How do I get the behaviour of my dev env in test env also? How do I make
> sure dependecies of dependencies does not come inot my war?
> > I am only using pom and and not the assembly descriptor.
> > Both environment have the same build script which checksout the latest
> > from SVN and then does
> mvn clean
> mvn compile
> mvn package
>
> Thanks
> Sunil
>
> --
> View this message in context:
> http://old.nabble.com/Is-there-a-way-to-disable-transitive-dependencies--tp28595375p28595375.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>