我们正在从SonarQube 5.3到SonarQube 5.6.6进行测试升级。我们将PMD插件升级到2.6。在测试构建期间,我收到此错误:
15-Aug-2017 12:23:39 [INFO] Sensor PmdSensor
15-Aug-2017 12:23:39 [INFO] Execute PMD 5.4.2...
15-Aug-2017 12:23:39 [INFO] Java version: 1.8
15-Aug-2017 12:23:39 [INFO] PMD configuration: /localdisk/home/bambooagent/agent1/bamboo-agent-home/xml-data/build-dir/myproj/TaskDashboard-war/target/sonar/pmd.xml
15-Aug-2017 12:23:39 Aug 15, 2017 12:23:39 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver visit
15-Aug-2017 12:23:39 WARNING: Could not find class com.myco.TaskDashboard.SampleClientApplication, due to: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ws/rs/core/Application
15-Aug-2017 12:23:39 [INFO] Execute PMD 5.4.2 done: 137 ms
和
15-Aug-2017 12:23:41 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project main: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ws/rs/core/Response$Status
15-Aug-2017 12:23:41 [ERROR] -----------------------------------------------------
15-Aug-2017 12:23:41 [ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2
15-Aug-2017 12:23:41 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
15-Aug-2017 12:23:41 [ERROR] urls[0] = file:/localdisk/home/bambooagent/agent1/bamboo-agent-home/xml-data/build-dir/mydir/maven_repo/local/org/sonarsource/scanner/maven/sonar-maven-plugin/3.0.2/sonar-maven-plugin-3.0.2.jar
我尝试使用sonar-maven-plugin 3.3.0.603在我的本地机器上做了同样的事情。
为什么更改SQ版本或PMD插件版本会导致编译问题?我应该在SQ5.6.6中使用什么版本的声纳-maven插件?
如何解决此问题? (请不要建议消除PMD,因为我们目前使用超过80条PMD规则,并且我无法在发布过程中随机更改规则。)