Fork me on GitHub

Development Guidelines

All plugins in the Mojo project should follow these guidelines.

  • Use the package org.codehaus.mojo.<plugin>, e.g.: org.codehaus.mojo.jpox.
  • Name the mojos like this: SomethingMojo. The name should reflect the goal of this mojo (i.e. the @goal javadoctag of the class).
  • Use org.codehaus.mojo for the groupId of any developed Maven plugin. Other projects/artifacts could use this groupId or a sub-context.
  • Use the <plugin>-maven-plugin convention for the artifactId of any developed Maven plugin.
  • Use the [Project] Maven Plugin convention to name your plugin e.g. "Acme Maven Plugin", unless [Project] reflects a trademark. In such case use either "Mojo's Acme Maven Plugin" or "Mojo's Maven Plugin for Acme" to clarify it is a plugin for this product and not by this product.
  • Use the Maven code style when formatting your code.
  • Configure your SVN client to properly add svn:eol-style and other properties to source files. See the example svn config file for details.
  • Do not check IDE specific files into version control but rather add those to svn:ignore.

Licensing

We accept any plugins that follow Codehaus's rules for licensing. We recommend that you use Codehaus's recommended license which is the MIT license. This license is usable for both ASL and GPL covered software. For other acceptable licenses please read the Codehaus license overview.

Make sure that you include the license in a file called LICENSE.txt in the root of your project and that all files include the license at the top of the file.

Mojo Parents

Released plugins should derive from the Mojo parent, for the latest version see Maven Central:

<project>
  <parent>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>mojo-parent</artifactId>
    <version>39</version>
  </parent>
  ...
</project>

Sandbox (new) plugins should derive from the Mojo sandbox parent:

<project>
  <parent>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>mojo-sandbox-parent</artifactId>
    <version>15</version>
  </parent>
  ...
</project>

See the FAQ and Graduating from the Sandbox for more details on sandbox development.

Plugin Site Template

Plugins should have a site that conforms to:

For Mojo Parent 16 and Newer

Mojo parent 16 introduces a common site.xml file that is included in the parent artifact. It is inherited by the projects that use this parent. This means that there are less things that you have to specify yourself. If you are using Mojo parent 16 or newer, place this in your plugin's src/site/site.xml:

<project xmlns="http://maven.apache.org/DECORATION/1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd">
  <body>
    <menu name="Overview">
      <item name="Introduction" href="index.html"/>
      <item name="Goals" href="plugin-info.html"/>
      <item name="Usage" href="usage.html"/>
      <item name="FAQ" href="faq.html"/>
    </menu>
    <menu name="Examples">
      <item name="description1" href="examples/example-one.html"/>
      <item name="description2" href="examples/example-two.html"/>
    </menu>
  </body>
</project>

Also make sure that the <name> element in your plugin's pom.xml contains this text:

  <name>XXXXX Maven Plugin</name>

This name is used in the title of the pages in the generated site.

For Mojo Parent 15 and Older

Place this in your plugin's src/site/site.xml for a starting point:

<project xmlns="http://maven.apache.org/DECORATION/1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd">
  <bannerLeft>
    <name>Mojo</name>
    <src>http://mojo.codehaus.org/images/mojo_logo.png</src>
    <href>http://mojo.codehaus.org</href>
  </bannerLeft>
  <bannerRight>
    <name>Codehaus</name>
    <src>http://mojo.codehaus.org/images/codehaus-small.png</src>
    <href>http://www.codehaus.org</href>
  </bannerRight>
  <body>
    <links>
      <item name="Mojo" href="http://mojo.codehaus.org"/>
      <item name="Maven" href="http://maven.apache.org/"/>
    </links>
    <menu name="Overview">
      <item name="Introduction" href="index.html"/>
      <item name="Goals" href="plugin-info.html"/>
      <item name="Usage" href="usage.html"/>
      <item name="FAQ" href="faq.html"/>
    </menu>
    <menu name="Examples">
      <item name="description1" href="examples/example-one.html"/>
      <item name="description2" href="examples/example-two.html"/>
    </menu>
    <menu ref="reports" />
  </body>
</project>