You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Shahim Essaid <sh...@essaid.com> on 2014/02/07 05:45:38 UTC

Activating a profile (add its build.plugins) from a plugin during validate phase

Hi,

Is it possible to activate a profile programmatically from a Mojo (or a
plugin lifecycle extension) in Maven 3?  I am trying to understand whether
or not I can add the "build.plugins" from an inherited (but inactive)
profile to the currently executing project during the validate phase. I
know I can do this with a custom ProfileActivator but I'd really like to do
this in a plugin to simplify sharing this functionality. I don't mind if
this involves using some internal APIs but I don't know where to start
looking. Any tips are greatly appreciated.

Best,
Shahim

Re: Activating a profile (add its build.plugins) from a plugin during validate phase

Posted by Stephen Connolly <st...@gmail.com>.
Please read my answer to a slightly different question:
http://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven/14727072#14727072

The question is different, but if you understand the answer I wrote, you
will have the answer to your question.


On 7 February 2014 04:45, Shahim Essaid <sh...@essaid.com> wrote:

> Hi,
>
> Is it possible to activate a profile programmatically from a Mojo (or a
> plugin lifecycle extension) in Maven 3?  I am trying to understand whether
> or not I can add the "build.plugins" from an inherited (but inactive)
> profile to the currently executing project during the validate phase. I
> know I can do this with a custom ProfileActivator but I'd really like to do
> this in a plugin to simplify sharing this functionality. I don't mind if
> this involves using some internal APIs but I don't know where to start
> looking. Any tips are greatly appreciated.
>
> Best,
> Shahim
>