Fork me on GitHub

Parent POM for all MojoHaus hosted Apache Maven plugins and components.

Latest build status: GitHub CI

Changelog

GitHub report

How to use the POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>mojo-parent</artifactId>
        <version>86</version>
    </parent>
    <groupId>sample-groupId</groupId>
    <artifactId>sample-project</artifactId>
    <version>1-SNAPSHOT</version>
    [...]
</project>

Spotless - automatic code formatting

MojoHaus Parent POM contains configuration for spotless-maven-plugin with options:

  • palantir code formatter
  • imports order as:
    • javax
    • java
    • other imports
    • static import

spotless will be activated in your project per default, if you don't want to use it

<properties>
   <spotless.check.skip>true</spotless.check.skip>
</properties>

To fix code, simply run:

mvn spotless:apply

Checkstyle

You can use checkstyle in order to verify code on each build.

Checkstyle can be enabled by adding to build/plugins`:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

Big code reformat

After applying bigger reformatting it is recommended to add or update a .git-blame-ignore-revs file in the root of the repository containing a line with the SHA1 of the formatting commit to ignore those changes when using git blame (or equivalent concepts).

This is automatically considered by GitHub and can optionally be considered with local git blame

Latest releases

… may be found at Maven Central.

Deploy site to github

To deploy a site to github using maven-scm-publish-plugin:

cd target/checkout
mvn -Preporting verify site-deploy