Maven build to be successful
Maven build fails with Failed during checkstyle configuration: cannot initialize module SuppressionFilter - Unable to find: suppressions.xml
Do mvn clean install on root directory
3.10.7-SNAPSHOT
Here is the exception from maven console that I get:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Redisson 3.10.7-SNAPSHOT:
[INFO]
[INFO] Redisson ........................................... SUCCESS [ 6.713 s]
[INFO] Redisson ........................................... FAILURE [08:34 min]
[INFO] Redisson/All-in-One ................................ SKIPPED
[INFO] Redisson/Tomcat .................................... SKIPPED
[INFO] Redisson/Tomcat-6 .................................. SKIPPED
[INFO] Redisson/Tomcat-7 .................................. SKIPPED
[INFO] Redisson/Tomcat-8 .................................. SKIPPED
[INFO] Redisson/Tomcat-9 .................................. SKIPPED
[INFO] Redisson/Spring Data Redis integration ............. SKIPPED
[INFO] Redisson/Spring Data Redis v1.6.x integration ...... SKIPPED
[INFO] Redisson/Spring Data Redis v1.7.x integration ...... SKIPPED
[INFO] Redisson/Spring Data Redis v1.8.x integration ...... SKIPPED
[INFO] Redisson/Spring Data Redis v2.0.x integration ...... SKIPPED
[INFO] Redisson/Spring Data Redis v2.1.x integration ...... SKIPPED
[INFO] Redisson/Spring Boot Starter ....................... SKIPPED
[INFO] Redisson/Hibernate ................................. SKIPPED
[INFO] Redisson/Hibernate-4.x ............................. SKIPPED
[INFO] Redisson/Hibernate-5.0.x-5.1.x ..................... SKIPPED
[INFO] Redisson/Hibernate-5.2.x ........................... SKIPPED
[INFO] Redisson/Hibernate-5.3.x+ .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:51 min
[INFO] Finished at: 2019-04-18T12:22:20-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (default) on project redisson: Failed during checkstyle configuration: cannot initialize module SuppressionFilter - Unable to find: suppressions.xml -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :redisson
Here is how I solved this issue :
1) Edit redisson\pom.xml and provide propertyExpansion property for maven-checkstyle-plugin:
so configuration for the plugin becomes from :
<configuration>
<consoleOutput>true</consoleOutput>
<enableRSS>false</enableRSS>
<configLocation>${basedir}/checkstyle.xml</configLocation>
</configuration>
To:
<configuration>
<consoleOutput>true</consoleOutput>
<enableRSS>false</enableRSS>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<propertyExpansion>checkstyle.config.path=${basedir}</propertyExpansion>
</configuration>
Here is the entire checkstyle maven plugin config:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<consoleOutput>true</consoleOutput>
<enableRSS>false</enableRSS>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<propertyExpansion>checkstyle.config.path=${basedir}</propertyExpansion>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>[8.18,)</version>
</dependency>
</dependencies>
</plugin>
2) Edit redisson\checkstyle.xml file:
Change this:
<module name="SuppressionFilter">
<property name="file" value="suppressions.xml"/>
<property name="optional" value="false"/>
</module>
To this:
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.config.path}/suppressions.xml"/>
<property name="optional" value="false"/>
</module>
If you are using IDE for the checkstyle you might need to set checkstyle.config.path variable to the proper value
@mrniko
Fixed! Thanks for the tip!
Most helpful comment
Here is the exception from maven console that I get:
Here is how I solved this issue :
1) Edit redisson\pom.xml and provide propertyExpansion property for maven-checkstyle-plugin:
so configuration for the plugin becomes from :
To:
Here is the entire checkstyle maven plugin config:
2) Edit redisson\checkstyle.xml file:
Change this:
To this:
If you are using IDE for the checkstyle you might need to set checkstyle.config.path variable to the proper value
@mrniko