Skip to content

Commit

Permalink
Configure checkstyle apache#14
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Jul 2, 2019
1 parent 7e3e865 commit 5e19c7f
Showing 1 changed file with 52 additions and 94 deletions.
146 changes: 52 additions & 94 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

<properties>
<supported-maven-versions>[3.5.3,)</supported-maven-versions>

<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
<maven-checkstyle.version>7.6.1</maven-checkstyle.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -164,25 +167,6 @@
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.6</version>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<configFile>${maven.multiModuleProjectDirectory}/ide-config/eclipse-format.xml</configFile>
<skip>${format.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.2.0</version>
<configuration>
<groups>java.,javax.,org.,com.</groups>
<staticGroups>*</staticGroups>
<skip>${format.skip}</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -215,81 +199,6 @@
</build>
</profile>

<profile>
<id>format</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!no-format</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
</goals>
</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>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>validate</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>no-format</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<id>check-imports</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<build>
Expand Down Expand Up @@ -359,5 +268,54 @@
</plugins>
</build>
</profile>
<profile>
<id>sourcecheck</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-buildtools</artifactId>
<!-- TODO not in M2 -->
<version>3.0.0-M3</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${maven-checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>default-cli</id>
<phase>validate</phase>
<configuration>
<includeResources>false</includeResources>
<configLocation>camel-checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>${checkstyle.failOnViolation}</failsOnError>
<linkXRef>false</linkXRef>
<suppressionsLocation>camel-checkstyle-suppressions.xml</suppressionsLocation>
<encoding>UTF-8</encoding>
<sourceDirectories>
<sourceDirectory>${basedir}/src</sourceDirectory>
</sourceDirectories>
<headerLocation>header-java.txt</headerLocation>
<includes>**/*.java,**/*.groovy,**/*.scala,**/*.properties,**/*.xml,**/*.xsd</includes>
<excludes>**/MyRoutes*.java</excludes>
</configuration>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 5e19c7f

Please sign in to comment.