You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wojciech Biela <il...@gmail.com> on 2006/07/07 16:12:46 UTC

activate a profile in a submodule

Further questions...

When I have a master module with different submodules, in a some of
the submodules I have some stuff done by a plugin, every time it's the
same thing, so I'd like to put that in the master pom, and not have to
repeat that big XML fragment in every submodule which needs this
plugin.

How to do it? I thought using profiles might help but it didn't.
Although I may define that plugin in a profile in the master pom, when
building the whole thing through the master module I didn't find a way
to activate that profile only for certain submodules (either from the
level of the master pom, or from within the submodules)...

any help appreciated

-- 
Wojtek Biela

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


Re: activate a profile in a submodule

Posted by Jesse McConnell <je...@gmail.com>.
I think this is a current shortcoming of profiles, if the profile is
activated at the top lvl then it is applied everywhere.  You might be
able to get away with having the profile at the top lvl not be bound
to any phases or goals but just set configuration on a plugin and then
in the actual submodules that you want to use it in bind the plugin to
the relevent phase and goal, but that kinda depends on the plugin to I
think, I doubt you can do that with the maven lifecycle plugins, but
some of the others an the mojo's you might be able to get away with
it.  And even then you should check to make sure the configurations
are getting merged, I know I worked with this a while back and thought
that the profile id's could be used to meld profile configuration
sections but I don't think that worked out the way I thought it
should.  Profiles are difficult to use when you start getting away
from the most simple cases, I think it is something like 'mvn
help:effective-pom' to see what you are ending up with.

good luck!

jesse



On 7/7/06, Wojciech Biela <il...@gmail.com> wrote:
> Further questions...
>
> When I have a master module with different submodules, in a some of
> the submodules I have some stuff done by a plugin, every time it's the
> same thing, so I'd like to put that in the master pom, and not have to
> repeat that big XML fragment in every submodule which needs this
> plugin.
>
> How to do it? I thought using profiles might help but it didn't.
> Although I may define that plugin in a profile in the master pom, when
> building the whole thing through the master module I didn't find a way
> to activate that profile only for certain submodules (either from the
> level of the master pom, or from within the submodules)...
>
> any help appreciated
>
> --
> Wojtek Biela
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
--
jesse mcconnell
jesse.mcconnell@gmail.com

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