Wednesday, March 17, 2010

maven create mojo

- Create mojo class with inheritance and annotation
  /**
   * @goal release
   * @aggregator
   */
  public class ReleaseMojo extends AbstractReleaseMojo {
- annotation for defining mojotype: @aggregator
- annotated configuration parameters: @parameter
- parameters can be: single valued, multi-valued(array), collection of items, collection of objects, map, Object
- getLog() gives maven logging functions.
- maven project and its configuration from pom.xml can be used by annotation
    /**
     * @parameter default-value="${project}"
     * @required
     */
     protected MavenProject mExecutionProject;

http://maven.apache.org/guides/plugin/guide-java-plugin-development.html
http://maven.apache.org/developers/mojo-api-specification.html#The_Descriptor_and_Annotations
http://maven.apache.org/ref/2.2.1/maven-plugin-api/apidocs/org/apache/maven/plugin/AbstractMojo.html




No comments:

Post a Comment