The Jalopy Maven Plugin is used to format java source files following a coding convention. For more information on Jalopy see their home page.
This plugin will format all java source files in the sourceDirectory and testDirectory following the configured coding convention. If you put your Jalopy configuration file here: $basedir/src/main/resources/jalopy.xml, it will be picked up by the plugin automatically. If you do not configure a convention the Jalopy default conventions will be used.
<project>
...
<build>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jalopy-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
</plugin>
</plugins>
...
</build>
...
</project>
You can use a custom Jalopy configuration file placed in a directory of your liking. For this example we want to use the file src/jalopy/my-jalopy-conventions.xml. This is how you would configure that.
<project>
...
<build>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jalopy-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<configuration>
<convention>src/jalopy/my-jalopy-conventions.xml</convention>
</configuration>
</plugin>
</plugins>
...
</build>
...
</project>
For all available configuration options see this page.
mvn jalopy:format