You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amaresh mourya <am...@gmail.com> on 2010/12/03 12:21:28 UTC

How to download transitive dependencies

Hi All,

I have a project(A) containing pom.xml and that have a dependency of
    <dependency>
      <groupId>ca.grimoire.maven</groupId>
      <artifactId>maven-utils-parent</artifactId>
      <version>1.0</version>
      <type>pom</type>
    </dependency>

And this maven-utils-parent-1.0.pom (in my local repository) has few
dependencies in <dependencyManagement>. Is it possible to download these
dependencies via some command. As when I run dependency:resolve on pom.xml
of project A, I got ca.grimoire.maven:maven-utils-parent:pom:1.0 in my local
repository. Is there any other command which can download all dependencies
including below ones..


<dependencyManagement>
    <dependencies>
      <!-- Internal project dependencies -->
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>maven-utils</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Third-party software -->
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
      </dependency>

      <!-- Java EE -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

Thanks,
Amaresh

Re: How to download transitive dependencies

Posted by Ron Wheeler <rw...@artifact-software.com>.
I would make the maven-utils into a jar project that produced a library 
of all of the utils and build that once.

Then each of the projects that needs these libraries would have a single 
dependency on your new "utils" jar.

I would remove the word maven from the name since these utilitiies have 
nothing to do with Maven

Ron

On 03/12/2010 8:35 AM, Brian Fox wrote:
> dependency:copy-dependencies sounds like what you want.
>
> On Fri, Dec 3, 2010 at 7:41 AM, amaresh mourya<am...@gmail.com>  wrote:
>> Hi,
>>
>> <dependencyManagement>
>>     <dependencies>
>>       <!-- Internal project dependencies -->
>>       <dependency>
>>         <groupId>${project.groupId}</groupId>
>>         <artifactId>maven-utils</artifactId>
>>         <version>${project.version}</version>
>>       </dependency>
>>
>>       <!-- Third-party software -->
>>       <dependency>
>>         <groupId>log4j</groupId>
>>         <artifactId>log4j</artifactId>
>>         <version>1.2.14</version>
>>       </dependency>
>>
>>       <dependency>
>>         <groupId>junit</groupId>
>>         <artifactId>junit</artifactId>
>>         <version>3.8.1</version>
>>         <scope>test</scope>
>>       </dependency>
>>
>>       <!-- Java EE -->
>>       <dependency>
>>         <groupId>javax.servlet</groupId>
>>         <artifactId>servlet-api</artifactId>
>>         <version>2.5</version>
>>         <scope>provided</scope>
>>       </dependency>
>>
>>       <dependency>
>>         <groupId>javax.servlet.jsp</groupId>
>>         <artifactId>jsp-api</artifactId>
>>         <version>2.1</version>
>>         <scope>provided</scope>
>>       </dependency>
>>     </dependencies>
>>   </dependencyManagement>
>>
>>
>> thanks for reply, I would like to know if the above transitive dependencies
>> would have been in<dependencies>  section rather that<dependencyManagement>
>> of maven-utils-parent-1.0.pom. Should I expect dependency:go-offline to
>> download them too, when I am running this goal on projectA's pom.xml (that
>> have dependency over maven-utils-parent-1.0 )
>>
>>
>> thanks,
>> Amaresh
>>
>> On Fri, Dec 3, 2010 at 5:47 PM, Stefan Seidel<ss...@vub.de>  wrote:
>>
>>> On Fri, 3 Dec 2010 17:39:23 +0530
>>> amaresh mourya<am...@gmail.com>  wrote:
>>>
>>>> No, running dependency:go-offline didn't do the job. It just downloads
>>>> plug-ins and immediate dependencies.
>>> It downloads all dependencies, these are not dependencies.
>>>
>>>>> And this maven-utils-parent-1.0.pom (in my local repository) has few
>>>>> dependencies in<dependencyManagement>. Is it possible to download
>>> these
>>> You should read
>>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Managementwhich says "the dependency management section is a mechanism for
>>> centralizing dependency information."
>>>
>>> So, to make it more clear: these are NOT dependencies. That's why they're
>>> not downloaded with the above command.
>>>
>>>>> [...] Is there any other command which can download all dependencies
>>>>> including below ones..
>>> Yes declare them as dependencies in your own pom.xml - because of the
>>> dependencyManagement entries, you will only need groupId, artifactId and
>>> maybe type.
>>>
>>> Stefan
>>>
>>> --
>>> Mit freundlichen Grüßen,
>>>
>>> Stefan Seidel
>>> Software-Entwickler
>>> ________________________
>>> VUB Printmedia GmbH
>>> Chopinstraße 4, 04103 Leipzig
>>> tel.    +49 (341) 9 60 50 93
>>> fax.    +49 (341) 9 60 50 92
>>> mail.   sseidel@vub.de
>>> web.    www.vub.de
>>>
>>> VUB Printmedia GmbH
>>> HRB Köln 24015
>>> GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf
>>>
>>> ---------------------------------------------------------------------
>>> 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 download transitive dependencies

Posted by Brian Fox <br...@infinity.nu>.
dependency:copy-dependencies sounds like what you want.

On Fri, Dec 3, 2010 at 7:41 AM, amaresh mourya <am...@gmail.com> wrote:
> Hi,
>
> <dependencyManagement>
>    <dependencies>
>      <!-- Internal project dependencies -->
>      <dependency>
>        <groupId>${project.groupId}</groupId>
>        <artifactId>maven-utils</artifactId>
>        <version>${project.version}</version>
>      </dependency>
>
>      <!-- Third-party software -->
>      <dependency>
>        <groupId>log4j</groupId>
>        <artifactId>log4j</artifactId>
>        <version>1.2.14</version>
>      </dependency>
>
>      <dependency>
>        <groupId>junit</groupId>
>        <artifactId>junit</artifactId>
>        <version>3.8.1</version>
>        <scope>test</scope>
>      </dependency>
>
>      <!-- Java EE -->
>      <dependency>
>        <groupId>javax.servlet</groupId>
>        <artifactId>servlet-api</artifactId>
>        <version>2.5</version>
>        <scope>provided</scope>
>      </dependency>
>
>      <dependency>
>        <groupId>javax.servlet.jsp</groupId>
>        <artifactId>jsp-api</artifactId>
>        <version>2.1</version>
>        <scope>provided</scope>
>      </dependency>
>    </dependencies>
>  </dependencyManagement>
>
>
> thanks for reply, I would like to know if the above transitive dependencies
> would have been in <dependencies> section rather that <dependencyManagement>
> of maven-utils-parent-1.0.pom. Should I expect dependency:go-offline to
> download them too, when I am running this goal on projectA's pom.xml (that
> have dependency over maven-utils-parent-1.0 )
>
>
> thanks,
> Amaresh
>
> On Fri, Dec 3, 2010 at 5:47 PM, Stefan Seidel <ss...@vub.de> wrote:
>
>> On Fri, 3 Dec 2010 17:39:23 +0530
>> amaresh mourya <am...@gmail.com> wrote:
>>
>> > No, running dependency:go-offline didn't do the job. It just downloads
>> > plug-ins and immediate dependencies.
>> It downloads all dependencies, these are not dependencies.
>>
>> > > And this maven-utils-parent-1.0.pom (in my local repository) has few
>> > > dependencies in <dependencyManagement>. Is it possible to download
>> these
>> You should read
>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Managementwhich says "the dependency management section is a mechanism for
>> centralizing dependency information."
>>
>> So, to make it more clear: these are NOT dependencies. That's why they're
>> not downloaded with the above command.
>>
>> > > [...] Is there any other command which can download all dependencies
>> > > including below ones..
>>
>> Yes declare them as dependencies in your own pom.xml - because of the
>> dependencyManagement entries, you will only need groupId, artifactId and
>> maybe type.
>>
>> Stefan
>>
>> --
>> Mit freundlichen Grüßen,
>>
>> Stefan Seidel
>> Software-Entwickler
>> ________________________
>> VUB Printmedia GmbH
>> Chopinstraße 4, 04103 Leipzig
>> tel.    +49 (341) 9 60 50 93
>> fax.    +49 (341) 9 60 50 92
>> mail.   sseidel@vub.de
>> web.    www.vub.de
>>
>> VUB Printmedia GmbH
>> HRB Köln 24015
>> GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf
>>
>> ---------------------------------------------------------------------
>> 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 download transitive dependencies

Posted by amaresh mourya <am...@gmail.com>.
Hi,

<dependencyManagement>
    <dependencies>
      <!-- Internal project dependencies -->
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>maven-utils</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Third-party software -->
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
      </dependency>

      <!-- Java EE -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>


thanks for reply, I would like to know if the above transitive dependencies
would have been in <dependencies> section rather that <dependencyManagement>
of maven-utils-parent-1.0.pom. Should I expect dependency:go-offline to
download them too, when I am running this goal on projectA's pom.xml (that
have dependency over maven-utils-parent-1.0 )


thanks,
Amaresh

On Fri, Dec 3, 2010 at 5:47 PM, Stefan Seidel <ss...@vub.de> wrote:

> On Fri, 3 Dec 2010 17:39:23 +0530
> amaresh mourya <am...@gmail.com> wrote:
>
> > No, running dependency:go-offline didn't do the job. It just downloads
> > plug-ins and immediate dependencies.
> It downloads all dependencies, these are not dependencies.
>
> > > And this maven-utils-parent-1.0.pom (in my local repository) has few
> > > dependencies in <dependencyManagement>. Is it possible to download
> these
> You should read
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Managementwhich says "the dependency management section is a mechanism for
> centralizing dependency information."
>
> So, to make it more clear: these are NOT dependencies. That's why they're
> not downloaded with the above command.
>
> > > [...] Is there any other command which can download all dependencies
> > > including below ones..
>
> Yes declare them as dependencies in your own pom.xml - because of the
> dependencyManagement entries, you will only need groupId, artifactId and
> maybe type.
>
> Stefan
>
> --
> Mit freundlichen Grüßen,
>
> Stefan Seidel
> Software-Entwickler
> ________________________
> VUB Printmedia GmbH
> Chopinstraße 4, 04103 Leipzig
> tel.    +49 (341) 9 60 50 93
> fax.    +49 (341) 9 60 50 92
> mail.   sseidel@vub.de
> web.    www.vub.de
>
> VUB Printmedia GmbH
> HRB Köln 24015
> GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to download transitive dependencies

Posted by Stefan Seidel <ss...@vub.de>.
On Fri, 3 Dec 2010 17:39:23 +0530
amaresh mourya <am...@gmail.com> wrote:

> No, running dependency:go-offline didn't do the job. It just downloads
> plug-ins and immediate dependencies.
It downloads all dependencies, these are not dependencies.

> > And this maven-utils-parent-1.0.pom (in my local repository) has few
> > dependencies in <dependencyManagement>. Is it possible to download these
You should read http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management which says "the dependency management section is a mechanism for centralizing dependency information."

So, to make it more clear: these are NOT dependencies. That's why they're not downloaded with the above command.

> > [...] Is there any other command which can download all dependencies
> > including below ones..

Yes declare them as dependencies in your own pom.xml - because of the dependencyManagement entries, you will only need groupId, artifactId and maybe type.

Stefan

-- 
Mit freundlichen Grüßen,

Stefan Seidel
Software-Entwickler
________________________
VUB Printmedia GmbH
Chopinstraße 4, 04103 Leipzig
tel.    +49 (341) 9 60 50 93
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de 
web.    www.vub.de

VUB Printmedia GmbH
HRB Köln 24015
GF Dr. A. Preuss Neudorf, Dr. C. Preuss Neudorf

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


Re: How to download transitive dependencies

Posted by amaresh mourya <am...@gmail.com>.
Hi,
No, running dependency:go-offline didn't do the job. It just downloads
plug-ins and immediate dependencies.


$ mvn dependency:go-offline
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ---------------------------------------------------------------------
[INFO] Building Unnamed - Application10:Project2:jar:1.0-SNAPSHOT
[INFO]    task-segment: [dependency:go-offline]
[INFO] ---------------------------------------------------------------------
[INFO] Preparing dependency:go-offline
[INFO] [dependency:resolve-plugins]
[INFO] Plugin Resolved: maven-compiler-plugin-2.0.2.jar
[INFO]     Plugin Dependency Resolved: maven-plugin-api-2.0.jar
[INFO]     Plugin Dependency Resolved: plexus-utils-1.0.4.jar
[INFO]     Plugin Dependency Resolved: plexus-compiler-api-1.5.3.jar
[INFO]     Plugin Dependency Resolved: plexus-compiler-manager-1.5.3.jar
[INFO]     Plugin Dependency Resolved: plexus-compiler-javac-1.5.3.jar
[INFO]     Plugin Dependency Resolved: maven-artifact-2.0.jar
[INFO] [dependency:go-offline]
[INFO] Resolved: cactus-maven-1.7.jar
[INFO] Resolved: maven-utils-parent-1.1.pom
[INFO] ---------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Dec 03 17:41:41 IST 2010
[INFO] Final Memory: 8M/19M
[INFO] ---------------------------------------------------------------------


Thanks,
Amaresh

On Fri, Dec 3, 2010 at 5:22 PM, Niels B Nielsen <
niels.b.nielsen@jpmorgan.com> wrote:

> would dependency:go-offline work?
>
> Regards
>
> -----Original Message-----
> From: amaresh mourya [mailto:amaresh.mourya@gmail.com]
> Sent: 03 December 2010 11:21
> To: Maven Users List
> Subject: How to download transitive dependencies
>
> Hi All,
>
> I have a project(A) containing pom.xml and that have a dependency of
>    <dependency>
>      <groupId>ca.grimoire.maven</groupId>
>      <artifactId>maven-utils-parent</artifactId>
>      <version>1.0</version>
>      <type>pom</type>
>    </dependency>
>
> And this maven-utils-parent-1.0.pom (in my local repository) has few
> dependencies in <dependencyManagement>. Is it possible to download these
> dependencies via some command. As when I run dependency:resolve on pom.xml
> of project A, I got ca.grimoire.maven:maven-utils-parent:pom:1.0 in my
> local
> repository. Is there any other command which can download all dependencies
> including below ones..
>
>
> <dependencyManagement>
>    <dependencies>
>      <!-- Internal project dependencies -->
>      <dependency>
>        <groupId>${project.groupId}</groupId>
>        <artifactId>maven-utils</artifactId>
>        <version>${project.version}</version>
>      </dependency>
>
>      <!-- Third-party software -->
>      <dependency>
>        <groupId>log4j</groupId>
>        <artifactId>log4j</artifactId>
>        <version>1.2.14</version>
>      </dependency>
>
>      <dependency>
>        <groupId>junit</groupId>
>        <artifactId>junit</artifactId>
>        <version>3.8.1</version>
>        <scope>test</scope>
>      </dependency>
>
>      <!-- Java EE -->
>      <dependency>
>        <groupId>javax.servlet</groupId>
>        <artifactId>servlet-api</artifactId>
>        <version>2.5</version>
>        <scope>provided</scope>
>      </dependency>
>
>      <dependency>
>        <groupId>javax.servlet.jsp</groupId>
>        <artifactId>jsp-api</artifactId>
>        <version>2.1</version>
>        <scope>provided</scope>
>      </dependency>
>    </dependencies>
>  </dependencyManagement>
>
> Thanks,
> Amaresh
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: How to download transitive dependencies

Posted by Niels B Nielsen <ni...@jpmorgan.com>.
would dependency:go-offline work?

Regards

-----Original Message-----
From: amaresh mourya [mailto:amaresh.mourya@gmail.com] 
Sent: 03 December 2010 11:21
To: Maven Users List
Subject: How to download transitive dependencies

Hi All,

I have a project(A) containing pom.xml and that have a dependency of
    <dependency>
      <groupId>ca.grimoire.maven</groupId>
      <artifactId>maven-utils-parent</artifactId>
      <version>1.0</version>
      <type>pom</type>
    </dependency>

And this maven-utils-parent-1.0.pom (in my local repository) has few
dependencies in <dependencyManagement>. Is it possible to download these
dependencies via some command. As when I run dependency:resolve on pom.xml
of project A, I got ca.grimoire.maven:maven-utils-parent:pom:1.0 in my local
repository. Is there any other command which can download all dependencies
including below ones..


<dependencyManagement>
    <dependencies>
      <!-- Internal project dependencies -->
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>maven-utils</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Third-party software -->
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
      </dependency>

      <!-- Java EE -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

Thanks,
Amaresh
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

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