You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Chris Graham <ch...@gmail.com> on 2013/02/22 23:55:39 UTC

Is there code too...?

Hi all.

For a multi module project, eg a root, with three modules A, B and C. C is dependent upon A and B.

I'll written a plugin that performs the packaging of C (actually, it's a WebSphere Message Broker BAR file).

I have two issues in finding artifacts.

1. Currently I need install to be called so that I can locate A and B in the local repo. I'd prefer to use the artifact from the package phase, ie from target.

Can anyone suggest or point me to some code that does something similar?

2. Unwinding transitive dependencies. Currently I need to manually, in the Pom, explicitly list all of the deps.

Eg, if B depends on A above, currently I need to list both A and B as deps of C.

Where I shod really only have to list B and I should be able to (transitively) infer that I also need A as well.

Is there a helper method somewhere that will unwind all of the dep tree and return the list of deps in a list (or similar)?

-Chris

Sent from my iPhone
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Is there code too...?

Posted by Chris Graham <ch...@gmail.com>.
On Sun, Feb 24, 2013 at 12:20 AM, Martin Gainty <mg...@hotmail.com> wrote:

> pluginManagement suggests a grouping of plugins to be inherited by child
> modules that inherit from parent
> This can be accomplished by declaring <pluginManagement> area in the
> parent pom.xml <packaging>pom</packaging>
> so that all child modules which inherit from this parent will auto-execute
> the executions suggested from the pluginManagement section of the parent pom
> http://maven.apache.org/pom.html#Plugin_Management
> If there are no plugins to execute (an executing plugin such as rebuilding
> WebSphere Message Broker) you can accomplish automatic inheritance of these
> locally installed plugins by declaring a <dependency-management>


There is, tht's the plugin that I wrote, that we're talking about here.

That along with a Project Interchange plugin, is what I use to roll out my
WMB maven builds.

>From the other responses, it looks like I should have a good look at the
dependency plugin, as that looks to be doing what I need.



> hierarchy..the main objective is to pass version and scope from parent to
> child modules inheriting from parent
> http://maven.apache.org/pom.html#Dependency_Management
>
> Martin Gainty
> ______________________________________________
> I will admit i am Clueless as to what 'biker term' is supposed to mean
> ----------------------------------------
> > Subject: Re: Is there code too...?
> > From: chrisgwarp@gmail.com
> > Date: Sat, 23 Feb 2013 19:21:24 +1100
> > To: dev@maven.apache.org
> >
> > Ta muchly! To all.
> >
> > -Chris
> >
> > Sent from my iPhone
> >
> > On 23/02/2013, at 6:54 PM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
> >
> > > On Friday, 22 February 2013, Chris Graham wrote:
> > >
> > >> Hi all.
> > >>
> > >> For a multi module project, eg a root, with three modules A, B and C.
> C is
> > >> dependent upon A and B.
> > >>
> > >> I'll written a plugin that performs the packaging of C (actually,
> it's a
> > >> WebSphere Message Broker BAR file).
> > >>
> > >> I have two issues in finding artifacts.
> > >>
> > >> 1. Currently I need install to be called so that I can locate A and B
> in
> > >> the local repo. I'd prefer to use the artifact from the package
> phase, ie
> > >> from target.
> > >>
> > >> Can anyone suggest or point me to some code that does something
> similar?
> > >
> > >
> > > Have a look at the changes I made to the maven-dependency-plugin's copy
> > > goal. One of the changes I made was to add resolution from the reactor
> for
> > > maven < 3.x (because 3.x+ will resolve from the reactor first)
> > >
> > >>
> > >> 2. Unwinding transitive dependencies. Currently I need to manually,
> in the
> > >> Pom, explicitly list all of the deps.
> > >>
> > >> Eg, if B depends on A above, currently I need to list both A and B as
> deps
> > >> of C.
> > >>
> > >> Where I shod really only have to list B and I should be able to
> > >> (transitively) infer that I also need A as well.
> > >>
> > >> Is there a helper method somewhere that will unwind all of the dep
> tree
> > >> and return the list of deps in a list (or similar)?
> > >
> > >
> > > I think dependency:copy-dependencies has some code that you can peg
> from
> > >
> > >
> > >>
> > >> -Chris
> > >>
> > >> Sent from my iPhone
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org<javascript:;>
> > >> For additional commands, e-mail: dev-help@maven.apache.org<javascript:;>
> > >>
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

RE: Is there code too...?

Posted by Martin Gainty <mg...@hotmail.com>.
pluginManagement suggests a grouping of plugins to be inherited by child modules that inherit from parent
This can be accomplished by declaring <pluginManagement> area in the parent pom.xml <packaging>pom</packaging>
so that all child modules which inherit from this parent will auto-execute the executions suggested from the pluginManagement section of the parent pom
http://maven.apache.org/pom.html#Plugin_Management
If there are no plugins to execute (an executing plugin such as rebuilding WebSphere Message Broker) you can accomplish automatic inheritance of these locally installed plugins by declaring a <dependency-management> hierarchy..the main objective is to pass version and scope from parent to child modules inheriting from parent
http://maven.apache.org/pom.html#Dependency_Management

Martin Gainty
______________________________________________
I will admit i am Clueless as to what 'biker term' is supposed to mean
----------------------------------------
> Subject: Re: Is there code too...?
> From: chrisgwarp@gmail.com
> Date: Sat, 23 Feb 2013 19:21:24 +1100
> To: dev@maven.apache.org
>
> Ta muchly! To all.
>
> -Chris
>
> Sent from my iPhone
>
> On 23/02/2013, at 6:54 PM, Stephen Connolly <st...@gmail.com> wrote:
>
> > On Friday, 22 February 2013, Chris Graham wrote:
> >
> >> Hi all.
> >>
> >> For a multi module project, eg a root, with three modules A, B and C. C is
> >> dependent upon A and B.
> >>
> >> I'll written a plugin that performs the packaging of C (actually, it's a
> >> WebSphere Message Broker BAR file).
> >>
> >> I have two issues in finding artifacts.
> >>
> >> 1. Currently I need install to be called so that I can locate A and B in
> >> the local repo. I'd prefer to use the artifact from the package phase, ie
> >> from target.
> >>
> >> Can anyone suggest or point me to some code that does something similar?
> >
> >
> > Have a look at the changes I made to the maven-dependency-plugin's copy
> > goal. One of the changes I made was to add resolution from the reactor for
> > maven < 3.x (because 3.x+ will resolve from the reactor first)
> >
> >>
> >> 2. Unwinding transitive dependencies. Currently I need to manually, in the
> >> Pom, explicitly list all of the deps.
> >>
> >> Eg, if B depends on A above, currently I need to list both A and B as deps
> >> of C.
> >>
> >> Where I shod really only have to list B and I should be able to
> >> (transitively) infer that I also need A as well.
> >>
> >> Is there a helper method somewhere that will unwind all of the dep tree
> >> and return the list of deps in a list (or similar)?
> >
> >
> > I think dependency:copy-dependencies has some code that you can peg from
> >
> >
> >>
> >> -Chris
> >>
> >> Sent from my iPhone
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org <javascript:;>
> >> For additional commands, e-mail: dev-help@maven.apache.org <javascript:;>
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 		 	   		  
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Is there code too...?

Posted by Chris Graham <ch...@gmail.com>.
Ta muchly! To all.

-Chris

Sent from my iPhone

On 23/02/2013, at 6:54 PM, Stephen Connolly <st...@gmail.com> wrote:

> On Friday, 22 February 2013, Chris Graham wrote:
> 
>> Hi all.
>> 
>> For a multi module project, eg a root, with three modules A, B and C. C is
>> dependent upon A and B.
>> 
>> I'll written a plugin that performs the packaging of C (actually, it's a
>> WebSphere Message Broker BAR file).
>> 
>> I have two issues in finding artifacts.
>> 
>> 1. Currently I need install to be called so that I can locate A and B in
>> the local repo. I'd prefer to use the artifact from the package phase, ie
>> from target.
>> 
>> Can anyone suggest or point me to some code that does something similar?
> 
> 
> Have a look at the changes I made to the maven-dependency-plugin's copy
> goal. One of the changes I made was to add resolution from the reactor for
> maven < 3.x (because 3.x+ will resolve from the reactor first)
> 
>> 
>> 2. Unwinding transitive dependencies. Currently I need to manually, in the
>> Pom, explicitly list all of the deps.
>> 
>> Eg, if B depends on A above, currently I need to list both A and B as deps
>> of C.
>> 
>> Where I shod really only have to list B and I should be able to
>> (transitively) infer that I also need A as well.
>> 
>> Is there a helper method somewhere that will unwind all of the dep tree
>> and return the list of deps in a list (or similar)?
> 
> 
> I think dependency:copy-dependencies has some code that you can peg from
> 
> 
>> 
>> -Chris
>> 
>> Sent from my iPhone
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org <javascript:;>
>> For additional commands, e-mail: dev-help@maven.apache.org <javascript:;>
>> 
>> 

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


Re: Is there code too...?

Posted by Stephen Connolly <st...@gmail.com>.
On Friday, 22 February 2013, Chris Graham wrote:

> Hi all.
>
> For a multi module project, eg a root, with three modules A, B and C. C is
> dependent upon A and B.
>
> I'll written a plugin that performs the packaging of C (actually, it's a
> WebSphere Message Broker BAR file).
>
> I have two issues in finding artifacts.
>
> 1. Currently I need install to be called so that I can locate A and B in
> the local repo. I'd prefer to use the artifact from the package phase, ie
> from target.
>
> Can anyone suggest or point me to some code that does something similar?


Have a look at the changes I made to the maven-dependency-plugin's copy
goal. One of the changes I made was to add resolution from the reactor for
maven < 3.x (because 3.x+ will resolve from the reactor first)

>
> 2. Unwinding transitive dependencies. Currently I need to manually, in the
> Pom, explicitly list all of the deps.
>
> Eg, if B depends on A above, currently I need to list both A and B as deps
> of C.
>
> Where I shod really only have to list B and I should be able to
> (transitively) infer that I also need A as well.
>
> Is there a helper method somewhere that will unwind all of the dep tree
> and return the list of deps in a list (or similar)?


I think dependency:copy-dependencies has some code that you can peg from


>
> -Chris
>
> Sent from my iPhone
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org <javascript:;>
> For additional commands, e-mail: dev-help@maven.apache.org <javascript:;>
>
>