Adding formatting pre-commit to Maven
<build>
<plugins>
+ <plugin>
+ <groupId>com.cosium.code</groupId>
+ <artifactId>git-code-format-maven-plugin</artifactId>
+ <version>2.5</version>
+ <executions>
+ <!-- On commit, format the modified java files -->
+ <execution>
+ <id>install-formatter-hook</id>
+ <goals>
+ <goal>install-hooks</goal>
+ </goals>
+ </execution>
+ <!-- On Maven verify phase, fail if any file
+ (including unmodified) is badly formatted -->
+ <execution>
+ <id>validate-code-format</id>
+ <goals>
+ <goal>validate-code-format</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.ec4j.maven</groupId>
<artifactId>editorconfig-maven-plugin</artifactId>
