Mojo framework
2009-08-22

Introduction

This document explains the mojo framework api of maven-helper-plugin.

The mojo framework aims to simplify the writing of new mojos.

To use this framework, your mojo classes MUST implements the contract org.nuiton.plugin.Plugin.

The framework use these technologies :

  • java 6
  • maven 2.2.1

How to use it

Implements the org.nuiton.plugin.AbstractPlugin class.

There is some filtering methods :

  • checkPackaging to test if can perform mojo for the project's packaging.
  • init : initialize the mojo, throw an error if any problem.
  • checkSkip to test if can skip mojo execution (since 1.2.0)

The core method is the doAction one, put there your logic.

Note: since version 1.2.0 the doAction method will only be executed if the mojo must be executed. you should no more do some tests here to know if the mojo can be skip.

Usefull methods

The org.nuiton.plugin.AbstractPlugin contains some usefull methods to work around the maven project and io operations on the files of the project.

For more explanations, see the javadoc.