Fix CheckStyle for individual module builds

This commit is contained in:
filoghost 2020-10-03 13:31:15 +02:00
parent 794f3faee1
commit ca9f45810a
2 changed files with 23 additions and 5 deletions

View File

@ -9,14 +9,14 @@
<property name="severity" value="warning"/>
<module name="SuppressionFilter">
<property name="file" value="checkstyle/suppressions.xml"/>
<property name="file" value="${samedir}/suppressions.xml"/>
</module>
<!-- Check that Java source files have the correct header -->
<module name="Header">
<property name="severity" value="error"/>
<property name="fileExtensions" value="java"/>
<property name="headerFile" value="checkstyle/header.txt"/>
<property name="headerFile" value="${samedir}/header.txt"/>
</module>
<!-- Check that files don't contain tabs -->

24
pom.xml
View File

@ -175,13 +175,31 @@
</pluginManagement>
<plugins>
<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<version>0.3.1</version>
<inherited>true</inherited>
<executions>
<execution>
<id>set-root-dir</id>
<phase>validate</phase>
<goals>
<goal>highest-basedir</goal>
</goals>
<configuration>
<property>rootDir</property>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>checkstyle/checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle/suppressions.xml</suppressionsLocation>
<headerLocation>checkstyle/header.txt</headerLocation>
<configLocation>${rootDir}/checkstyle/checkstyle.xml</configLocation>
<propertyExpansion>samedir=${rootDir}/checkstyle</propertyExpansion>
<sourceDirectories>
<sourceDirectory>${project.basedir}</sourceDirectory>
</sourceDirectories>