测试人社区

jenkins构建java报错java.lang.NoSuchMethodError原因

sonarqube版本:7.4
mysql:5.7


Jenkins 2.260
linux环境
控制台输出:
INFO: Error stacktraces are turned on. INFO: Runner configuration file: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-runner.properties INFO: Project configuration file: NONE INFO: Default locale: “en_US”, source code encoding: “UTF-8” DEBUG: Other system properties: DEBUG: - sun.arch.data.model: “64” INFO: Server: http://10.1.220.5:9099 INFO: Work directory: /var/lib/jenkins/workspace/zhaofang_app/.sonar INFO: Cache directory: /root/.sonar/cache DEBUG: Looking for /root/.sonar/cache/ca892554e2a573da03bc25145df14ef9/sonar-scanner-engine-shaded-7.4-all.jar INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 0.255s INFO: Final Memory: 8M/1204M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution org.sonar.runner.RunnerException: Unable to execute Sonar at org.sonar.runner.Runner.delegateExecution(Runner.java:369) at org.sonar.runner.Runner.execute(Runner.java:190) at org.sonar.runner.Main.execute(Main.java:100) at org.sonar.runner.Main.execute(Main.java:76) at org.sonar.runner.Main.main(Main.java:62) Caused by: java.lang.NoSuchMethodError: org.sonar.batch.bootstrapper.Batch$Builder.setProjectReactor(Lorg/sonar/api/batch/bootstrap/ProjectReactor;)Lorg/sonar/batch/bootstrapper/Batch$Builder; at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:93) at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.sonar.runner.Runner.delegateExecution(Runner.java:366) … 4 more WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed? WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeed? ERROR: SonarQube scanner exited with non-zero code: 1 Archiving artifacts [Checks API] No suitable checks publisher found. [WS-CLEANUP] Deleting project workspace… [WS-CLEANUP] Deferred wipeout is used… [WS-CLEANUP] done Finished: FAILURE