Note: this thread is about writing a custom Mojo, not using a plugin.
I maintain a testing plugin for Maven. Unfortunately, for almost a year now, I\'ve let
You could have something like the below (taken from the CompilerMojo):
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
* @version $Id: CompilerMojo.java 941498 2010-05-05 21:24:11Z krosenvold $
* @since 2.0
* @goal compile
* @phase compile
* @threadSafe
* @requiresDependencyResolution compile
*/
By setting this over your class, it will execute during the compile phase (in this example). The compile phase requires all the previous phases to have executed first (validate, generate-sources, process-sources, generate-resources, process-resources
...).
Basically, pick a phase after the one you need (or even the same one) and it should work.