这是完整的错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (default) on project abc-123-micro-service: Failed during checkstyle configuration: cannot initialize module StrictDuplicateCode - Unable to instantiate 'StrictDuplicateCode' class, it is also not possible to instantiate it as .StrictDuplicateCode, StrictDuplicateCodeCheck, .StrictDuplicateCodeCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly. -> [Help 1]
我对 checkstyle 插件的 Maven 配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.8</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
我的 checkstyle.xml 配置文件不包含错误中提到的任何“重复”规则。如何解决此问题并让所有检查通过?
编辑:checkstyle.xml 的内容:https ://pastebin.com/kuJAFiiP