Example

Below you find a complete POM that performs formatting after each compile run finished successfully, disables logging of Javadoc related messages, only displays messages with warning severity or higher, activates the profile "test" during formatting and imports a code convention from a shared server. Formatting is applied to all Java source files of the project that are not located below the "testdata" folder.

Example 12.1. Maven POM

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>testing</groupId>
  <artifactId>test</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Maven Quick Start Archetype</name>
  <url>http://maven.apache.org</url>
  <build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>1.5</source>
        <target>1.5</target>
      </configuration>
    </plugin>
    <plugin>
      <groupId>triemax</groupId>
      <artifactId>jalopy-maven</artifactId>
      <configuration>
        <javadoc>false</javadoc>
        <logLevel>warn</logLevel>
        <profile>test</profile>
        <convention>http://tools/jalopy/config/foo.xml</convention>
        <includes>
          <include>**/*.java</include>
        </includes>
        <excludes>
          <exclude>**/testdata/**</exclude>
        </excludes>
        <environment>
        </environment>
      </configuration>
      <executions>
        <execution>
          <phase>process-classes</phase>
          <goals>
            <goal>format</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>