所以在這裏我case,checkstyle-suppressions.xml
兩個checkstyle.xml和pom.xml中指定:定義鎮壓在checkstyle.xml過濾VS的pom.xml - Maven的插件的CheckStyle
checkstyle.xml:
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppressions.xml"/>
</module>
的pom.xml
<project>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
我不是曲請確定是否需要在兩個文件中定義它,其中一個文件中包含SuppressionFilter
模塊和<suppressionsLocation>
標記。
我想用https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml與其他項目。然而在pom.xml與<configLocation>
一套這樣做對https://github.com/openmrs/openmrs-core/blob/master/checkstyle.xml
時,的CheckStyle,插件失敗,錯誤:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project webservices.rest: Failed during checkstyle configuration: cannot initialize module SuppressionFilter - Cannot set property 'file' to 'checkstyle-suppressions.xml' in module SuppressionFilter: InvocationTargetException: Unable to find: checkstyle-suppressions.xml -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (validate) on project webservices.rest: Failed during checkstyle configuration
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed during checkstyle configuration
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module SuppressionFilter - Cannot set property 'file' to 'checkstyle-suppressions.xml' in module SuppressionFilter
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Cannot set property 'file' to 'checkstyle-suppressions.xml' in module SuppressionFilter