Add code formatter plugins

This commit is contained in:
Peter Palaga
2020-07-29 11:44:54 +02:00
parent fa8903d5c8
commit 213edf6712
3 changed files with 326 additions and 0 deletions

48
pom.xml
View File

@@ -49,6 +49,8 @@
<!-- plugin versions a..z -->
<compiler.version>3.8.1</compiler.version>
<formatter-maven-plugin.version>2.12.1</formatter-maven-plugin.version>
<impsort-maven-plugin.version>1.4.1</impsort-maven-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<mrm.version>1.2.0</mrm.version>
<surefire.version>3.0.0-M4</surefire.version>
@@ -244,6 +246,26 @@ limitations under the License.</inlineHeader>
<artifactId>takari-lifecycle-plugin</artifactId>
<version>${takari-lifecycle.version}</version>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>${formatter-maven-plugin.version}</version>
<configuration>
<configFile>${maven.multiModuleProjectDirectory}/build/eclipse-formatter-config.xml</configFile>
<skip>${format.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>${impsort-maven-plugin.version}</version>
<configuration>
<removeUnused>true</removeUnused>
<staticAfter>true</staticAfter>
<lineEnding>KEEP</lineEnding>
<skip>${format.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -285,6 +307,32 @@ limitations under the License.</inlineHeader>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<id>format</id>
<goals>
<goal>format</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>