我想补充一下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.9.0</version>
<executions>
<execution>
<id>pmd-check</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>code-analysis/ruleset.xml</ruleset>
</rulesets>
</configuration>
</plugin>用ruleset.xml
<?xml version="1.0"?>
<ruleset name="Custom ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
The default ruleset
</description>
<rule ref="rulesets/java/strings.xml">
<exclude name="AvoidDuplicateLiterals"/>
</rule>
<rule ref="rulesets/java/strings.xml/AvoidDuplicateLiterals">
<properties>
<property name="skipAnnotations" value="true"/>
</properties>
</rule>
<rule ref="rulesets/java/unusedcode.xml"/>
<rule ref="rulesets/java/strictexception.xml"/>
</ruleset>到素数面的POM,因为
未能在项目素数面上执行目标org.apache.maven.plugins:maven-pmd-plugin:3.9.0:pmd:执行目标org.apache.maven.plugins:maven-pmd-plugin:3.9.0:pmd的pmd失败:在类文件javax/faces/application/FacesMessage$ org.apache.maven.plugins:maven-pmd-plugin:3.9.0:pmd中执行非本地或抽象的方法中的org.apache.maven.plugins:maven-pmd-plugin:3.9.0:pmd: java.lang.ClassFormatError:缺席代码属性时遇到了API不兼容性
当运行mvn validate (或mvn clean install)时。
在服务器上部署Java应用程序时,有很多解释如何处理这个特定的错误,但是这使得很难找到一种可能适用于插件执行的方法。
将java.lang.ClassFormatError:类文件javax/faces/webapp/FacesServlet中不存在本机或抽象方法中的代码属性中建议的依赖项添加到插件的dependencies中的任何组合都不会更改错误。
我注意到这个错误发生在3.5.2,而不是3.3.9,但是我看到了失败--这可能是Maven错误。
我使用的是maven-pmd-plugin3.9.0,它使用的是PMD7.0.0。
发布于 2018-05-22 00:56:29
此行为是由已在https://github.com/pmd/pmd/issues/1131上提交的PMD问题引起的。
https://stackoverflow.com/questions/50430684
复制相似问题