We need the ability to bind a Mojo to a custom LifeCycle.
Our specific use case is to be able to perform extra tasks during release that need to occur at times other than the small window provided by the maven-release-plugin's run-preparation-goals and run-perform-goals phases. In particular we need Mojos to execute during the scm-commit-development and scm-commit-rollback phases.
So we need the ability to bind our plugin's Mojos to those phases.
I would think that there are probably many other use cases, for other custom LifeCycles, not only for the release-plugin.
A mechanism for binding Mojos to custom LifeCycles provides a much cleaner mechanism for plugins like the release-plugin that are aware that they need to integrate with other plugins.
I would like to propose a syntax similar to:
<plugin> <groupId>com.yarris.maven.plugins</groupId> <artifactId>maven-subclipse-tags-plugin</artifactId> <version>1.3</version> <executions> <execution> <-- Bind to the release-plugin:scm-commit-development phase. --> <phase>org.apache.maven.plugins:maven-release-plugin:scm-commit-development</phase> <goals> <goal>update-property</goal> </goals> </execution> </executions> </plugin>
where the groupId and artifact binding of the phase follow the same defaulting process at that used to define dependencies. That is the above binding could be rewritten as:
<-- Bind to the release-plugin:scm-commit-development phase. --> <phase>maven-release-plugin:scm-commit-development</phase>
<-- Bind to the release-plugin:scm-commit-development phase. --> <phase>release:scm-commit-development</phase>
The other (IMHO poorer) option would be to include the LifeCycle of the release-plugin as part of the Maven core.
Without this proposal we will
- need to continue to maintain a version of release-plugin that includes extra phases required to simulate this behaviour
- not be able to open-source the subclipse-tags-plugin (which is of benefit to anyone using Eclipse+Subversion) as it needs the hooks provided by our hacked version of the release-plugin.
I'd really like to use a base version of the release-plugin and I'd really like to be able to provide the subclispe-tags-plugin to the community.
NB this was originally raised as http://jira.codehaus.org/browse/MRELEASE-235