Lifecycle participant may be able to help here, but also it may be "too early" for your use case. I second Niels, would be good to see some use cases.
T On Mon, Aug 14, 2023, 18:26 Nils Breunese <n...@breun.nl> wrote: > Justin Lee <j...@antwerkz.com> 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: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >