You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Phillip Hellewell <ss...@gmail.com> on 2010/10/01 20:04:21 UTC

Which goal fetches dependencies?

It appears that dependencies get downloaded from a remote repository
to local repository during the "compile" phase, but which goal of the
compile phase does that?

Is it just the compiler:compile goal?  If so, does that mean I can't
fetch dependencies to my local repository without also doing a
compile?  Why should it be that way?

A more general question, isn't there a way to list all the goals bound
to all the phases?  I can't believe Maven has no way to show these,
but after scouring the mail archives that is the impression I get.

Phillip

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


Re: Which goal fetches dependencies?

Posted by Justin Edelson <ju...@gmail.com>.
On 10/1/10 2:32 PM, Phillip Hellewell wrote:
> On Fri, Oct 1, 2010 at 12:11 PM, Justin Edelson <ju...@gmail.com> wrote:
>> Dependencies are resolved by Maven whenever a Mojo's metadata indicates that dependency resolution is a prerequisite to Mojo execution. This can happen in any phase.
> 
> Is there any way to just do just the dependency resolution without
> doing the rest of the phase?
> 
> Phillip

If you want to resolve dependencies before the compile phase, write a
Mojo that has
@requiresDependencyResolution and then bind that goal to a phase before
compile.

Justin

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


Re: Which goal fetches dependencies?

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 1, 2010 at 1:11 PM, Anders Hammar <an...@hammar.net> wrote:
>> What I still don't quite understand is the documentation for
>> dependency:resolve says that it binds by default to the
>> generate-sources phase, yet when I do a mvn generate-sources, it does
>> not fetch the dependencies to my local repository.
>>
>
> What that means is that if you bind that plugin goal to the lifecycle but
> don't specify any phase (i.e. define it in the plugins section of your pom),
> it will bind to that phase by default.

Ah, ok.  Thanks for explaining that.

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


Re: Which goal fetches dependencies?

Posted by Anders Hammar <an...@hammar.net>.
> What I still don't quite understand is the documentation for
> dependency:resolve says that it binds by default to the
> generate-sources phase, yet when I do a mvn generate-sources, it does
> not fetch the dependencies to my local repository.
>

What that means is that if you bind that plugin goal to the lifecycle but
don't specify any phase (i.e. define it in the plugins section of your pom),
it will bind to that phase by default.

/Anders

Re: Which goal fetches dependencies?

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 1, 2010 at 12:36 PM, Wayne Fay <wa...@gmail.com> wrote:
>> Is there any way to just do just the dependency resolution without
>> doing the rest of the phase?
>
> dependency:go-offline perhaps?
> http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

Sweet, that worked great!  Also, it looks like dependency:resolve
works too.  Not sure why I didn't think of that earlier.

What I still don't quite understand is the documentation for
dependency:resolve says that it binds by default to the
generate-sources phase, yet when I do a mvn generate-sources, it does
not fetch the dependencies to my local repository.

Phillip

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


Re: Which goal fetches dependencies?

Posted by Wayne Fay <wa...@gmail.com>.
> Is there any way to just do just the dependency resolution without
> doing the rest of the phase?

dependency:go-offline perhaps?
http://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

Wayne

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


Re: Which goal fetches dependencies?

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 1, 2010 at 12:11 PM, Justin Edelson <ju...@gmail.com> wrote:
> Dependencies are resolved by Maven whenever a Mojo's metadata indicates that dependency resolution is a prerequisite to Mojo execution. This can happen in any phase.

Is there any way to just do just the dependency resolution without
doing the rest of the phase?

Phillip

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


Re: Which goal fetches dependencies?

Posted by Justin Edelson <ju...@gmail.com>.
Dependencies are resolved by Maven whenever a Mojo's metadata indicates that dependency resolution is a prerequisite to Mojo execution. This can happen in any phase.

Justin

On Oct 1, 2010, at 2:04 PM, Phillip Hellewell <ss...@gmail.com> wrote:

> It appears that dependencies get downloaded from a remote repository
> to local repository during the "compile" phase, but which goal of the
> compile phase does that?
> 
> Is it just the compiler:compile goal?  If so, does that mean I can't
> fetch dependencies to my local repository without also doing a
> compile?  Why should it be that way?
> 
> A more general question, isn't there a way to list all the goals bound
> to all the phases?  I can't believe Maven has no way to show these,
> but after scouring the mail archives that is the impression I get.
> 
> Phillip
> 
> ---------------------------------------------------------------------
> 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