Justin Lee <[email protected]> wrote:

> I understand that.  My question was doing that programmatically because my
> situation is rather dynamic and codify it in the pom is not what I need.

You wrote: "I'm trying to write a plugin (…) that can arbitrarily bind 
functionality to different lifecycle phases based on the configuration in the 
pom file."

Maven executes a plugin goal in a lifecycle phase, either its default phase, or 
the phase configured by a user. Users can bind plugin goals to any lifecycle 
phase using the <executions> tag in the pom file. To me that sounded basically 
like what you described you wanted. Can you maybe explain your use case in some 
more detail to explain why it can’t use default’s mechanism for binding plugin 
goals to phases?

Note that a plugin cannot dynamically control in which phase it gets executed 
itself, because when it’s executed, it’s already executed in a particular 
phase. If you want to hook deeper into Maven’s behavior, you will indeed need 
to look into writing either a build extension or (even deeper) a core 
extension: https://maven.apache.org/guides/mini/guide-using-extensions.html

Nils.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to