我已将Sonar从3.0.1升级到版本3.3.1, 和我的代码analisys工作已被打破。
所有带代码analisys作业的项目都是具有层次结构的多模块maven项目
在先前版本的声纳(3.0.1)上,作业配置了一个maven构建步骤:
org.codehaus.sonar:sonar-maven3-plugin:3.0.1:sonar -P sonar -X
(声纳服务器信息存储在名为“sonar”的maven配置文件中)
现在我已将此构建步骤更改为
org.codehaus.sonar:sonar-maven3-plugin:3._3_.1:sonar -P sonar -X
现在构建失败了。
有谁知道解决方案?
有一个stackTrace:
6:48:21 Waiting for Jenkins to finish collecting data 16:48:21 mavenExecutionResult exceptions not empty 16:48:21 message : Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar (default-cli) on project proj-parent: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value 16:48:21 cause : Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value 16:48:21 Stack trace : 16:48:21 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar (default-cli) on project proj-parent: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value 16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) 16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 16:48:21 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 16:48:21 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 16:48:21 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 16:48:21 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 16:48:21 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) 16:48:21 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 16:48:21 at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) 16:48:21 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:48:21 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 16:48:21 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:48:21 at java.lang.reflect.Method.invoke(Method.java:601) 16:48:21 at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) 16:48:21 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) 16:48:21 at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) 16:48:21 at hudson.maven.Maven3Builder.call(Maven3Builder.java:98) 16:48:21 at hudson.maven.Maven3Builder.call(Maven3Builder.java:64) 16:48:21 at hudson.remoting.UserRequest.perform(UserRequest.java:118) 16:48:21 at hudson.remoting.UserRequest.perform(UserRequest.java:48) 16:48:21 at hudson.remoting.Request$2.run(Request.java:326) 16:48:21 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 16:48:21 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 16:48:21 at java.util.concurrent.FutureTask.run(FutureTask.java:166) 16:48:21 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 16:48:21 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 16:48:21 at java.lang.Thread.run(Thread.java:722) 16:48:21 Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar failed: null value 16:48:21 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) 16:48:21 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 16:48:21 ... 27 more 16:48:21 Caused by: java.lang.NullPointerException: null value 16:48:21 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) 16:48:21 at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:139) 16:48:21 at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:178) 16:48:21 at com.google.common.collect.Maps.fromProperties(Maps.java:594) 16:48:21 at org.sonar.batch.bootstrapper.Batch.(Batch.java:50) 16:48:21 at org.sonar.batch.bootstrapper.Batch.(Batch.java:38) 16:48:21 at org.sonar.batch.bootstrapper.Batch$Builder.build(Batch.java:148) 16:48:21 at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:133) 16:48:21 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 16:48:21 ... 28 more 16:48:21 Sending e-mails to: ***** 16:48:21 channel stopped
答案 0 :(得分:0)
对我有用的解决方案:
1)添加pre -build步骤 - 构建具有目标 celan install
的maven项目2)主要构建步骤是相同的
org.codehaus.sonar:sonar-maven3-plugin:3.3.1:sonar -P sonar -X