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.
On Mon, Aug 14, 2023, 5:13 AM Nils Breunese <n...@breun.nl> wrote: > Justin Lee <j...@antwerkz.com> wrote: > > > I'm trying to write a plugin, it's probably an extension but whatever, > that > > can arbitrarily bind functionality to different lifecycle phases based on > > the configuration in the pom file. I'm curious 1) if this is even > possible > > in maven, and 2) how I would go about that. > > Maven includes this functionality via the <executions> tag, you don’t need > to do anything in the code of a Maven plugin for this: > https://maven.apache.org/guides/mini/guide-configuring-plugins.html#using-the-executions-tag > > Example: > > <build> > <plugins> > <plugin> > <groupId>org.example</groupId> > <artifactId>example-maven-plugin</artifactId> > <version>1.0.0</version> > <executions> > <execution> > <id>example-execution1</id> > <goals> > <goal>example-goal</goal> > <goals> > <phase>test</phase> <!-- Use any phase you like: > https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#lifecycle-reference > --> > </execution> > </executions> > </plugin> > </plugins> > </build> > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >