You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ch...@emc.com on 2012/02/13 19:20:10 UTC

dependency plugin usage

I'm wondering what the difference would be between the following two ways of handling copying of a certain type of maven dependency.  The dependency I'm talking about is something like, for instance, a self-extracting installer that I want to bundle with my custom assembly.   I've deployed this installer as a maven artifact.  Initially, I didn't think  of it as a normal maven dependency, since it's not a compile dependency, so I set the build up to use the maven-dependency-plugin:copy mojo.  This works great.  However, I then started wondering whether I should just declare the dependency in my dependencies and then use the maven-dependency-plugin:copy-dependencies mojo.

Can anyone provide some insight as to whether either way is better or worse?

Re: dependency plugin usage

Posted by Stephen Connolly <st...@gmail.com>.
On 13 February 2012 18:20,  <Ch...@emc.com> wrote:
> I'm wondering what the difference would be between the following two ways of handling copying of a certain type of maven dependency.  The dependency I'm talking about is something like, for instance, a self-extracting installer that I want to bundle with my custom assembly.   I've deployed this installer as a maven artifact.  Initially, I didn't think  of it as a normal maven dependency, since it's not a compile dependency, so I set the build up to use the maven-dependency-plugin:copy mojo.

The rule of thumb is use dependency:copy if the dependency comes from
outside your reactor, as dependency:copy will not affect the build
order, and you might need to influence the build order. [can always
add a >pom< typed dependency to force the build order if needed

> This works great.  However, I then started wondering whether I should just declare the dependency in my dependencies and then use the maven-dependency-plugin:copy-dependencies mojo.

this one is equally good, but will (by definition) ensure that the
reactor is built in the correct sequence for dependencies from the
reactor... but in some cases, you may not want this as, by necessity,
listing dependencies can influence the classpath if the dependencies
are of type >jar<

>
> Can anyone provide some insight as to whether either way is better or worse?

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