I developed my own Maven plugin and annotated its Mojo as:
@Mojo(name="bt-hello-world", defaultPhase=LifecyclePhase.COMPILE)
I use this plugin in another Maven project as:
<project ...>
...
<build>
<plugins>
<plugin>
<groupId>com.bt.maven.learning</groupId>
<artifactId>app-one</artifactId>
<version>1.0-SNAPSHOT</version>
</plugin>
</plugins>
</build>
</project>
It wouldn't get executed. I then added @Execute(goal="bt-hello-world", phase=LifecyclePhase.COMPILE, lifecycle="default")
to the Mojo in order to avoid using <executions>
, but still doesn't work.
If I do add <executions>
it does work. However, I have seen projects that use plugins without <executions>
and their goals get executing.
What am I missing?