我玩了! web插件项目,我正在编译和运行JaCoCo。在此之后,我想使用Sonar跑步者进行声纳分析。我们已经启动并运行了SonarQube 4.0服务器,并且我安装了Sonar Runner 2.3。我正在使用本地Bamboo远程代理在VM上运行所有与构建相关的任务。
在运行“sonar-runner -X -e”
结束时出现以下错误14:05:14.998 INFO - Analysing <path-to>/jacoco.exec
06-Dec-2013 17:05:15 14:05:15.008 DEBUG - Release semaphore on project : org.sonar.api.resources.Project@5ca267af[id=52670,key=work.stuff:Web-Plugin,qualifier=TRK], with key batch-work.stuff:Web-Plugin
06-Dec-2013 17:05:15 14:05:15.401 DEBUG - To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
06-Dec-2013 17:05:15 INFO: ------------------------------------------------------------------------
06-Dec-2013 17:05:15 INFO: EXECUTION FAILURE
06-Dec-2013 17:05:15 INFO: ------------------------------------------------------------------------
06-Dec-2013 17:05:15 Total time: 6:31.254s
06-Dec-2013 17:05:15 ERROR: Error during Sonar runner execution
06-Dec-2013 17:05:15 org.sonar.runner.impl.RunnerException: Unable to execute Sonar
06-Dec-2013 17:05:15 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
06-Dec-2013 17:05:15 at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
06-Dec-2013 17:05:15 at java.security.AccessController.doPrivileged(Native Method)
06-Dec-2013 17:05:15 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
06-Dec-2013 17:05:15 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
06-Dec-2013 17:05:15 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
06-Dec-2013 17:05:15 at org.sonar.runner.api.Runner.execute(Runner.java:90)
06-Dec-2013 17:05:15 at org.sonar.runner.Main.executeTask(Main.java:70)
06-Dec-2013 17:05:15 at org.sonar.runner.Main.execute(Main.java:59)
06-Dec-2013 17:05:15 at org.sonar.runner.Main.main(Main.java:41)
06-Dec-2013 17:05:15 Caused by: java.lang.NullPointerException
06-Dec-2013 17:05:15 at org.sonar.plugins.jacoco.ExecutionDataVisitor.visitClassExecution(ExecutionDataVisitor.java:48)
06-Dec-2013 17:05:15 at org.jacoco.core.data.ExecutionDataReader.readExecutionData(ExecutionDataReader.java:149)
06-Dec-2013 17:05:15 at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:113)
06-Dec-2013 17:05:15 at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
06-Dec-2013 17:05:15 at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:133)
06-Dec-2013 17:05:15 at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:106)
06-Dec-2013 17:05:15 at org.sonar.plugins.jacoco.JaCoCoSensor.analyse(JaCoCoSensor.java:54)
06-Dec-2013 17:05:15 at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
06-Dec-2013 17:05:15 at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:190)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:185)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:178)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
06-Dec-2013 17:05:15 Final Memory: 27M/664M
06-Dec-2013 17:05:15 INFO: ------------------------------------------------------------------------
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:58)
06-Dec-2013 17:05:15 at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
06-Dec-2013 17:05:15 at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
06-Dec-2013 17:05:15 at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:155)
06-Dec-2013 17:05:15 at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:143)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
06-Dec-2013 17:05:15 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
06-Dec-2013 17:05:15 at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
06-Dec-2013 17:05:15 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
06-Dec-2013 17:05:15 at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
06-Dec-2013 17:05:15 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06-Dec-2013 17:05:15 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
06-Dec-2013 17:05:15 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
06-Dec-2013 17:05:15 at java.lang.reflect.Method.invoke(Method.java:601)
06-Dec-2013 17:05:15 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
06-Dec-2013 17:05:15 ... 9 more
06-Dec-2013 17:05:16 Failing task since return code of [<bamboo-stuff>-ScriptBuildTask-4543364793727960070.sh] was 1 while expected 0
我的sonar-project.properties文件如下所示: 它位于我项目树的头部,我正在使用的所有路径都已经过验证。
# Required metadata
sonar.projectKey=<work.stuff>:Web-Plugin
sonar.projectName=Web-Plugin
sonar.projectVersion=0.0.1-SNAPSHOT
# Paths to source directories.
# Paths are relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Do not put the "sonar-project.properties" file in the same directory with the source code.
# (i.e. never set the "sonar.sources" property to ".")
sonar.sources=app
# The value of the property must be the key of the language.
sonar.language=java
#----- JaCoCo Stuff
sonar.jacoco.reportPath=target/scala-2.10/jacoco/jacoco.exec
#----- JUnit test Stuff
sonar.junit.reportsPath=target/test-reports/
#----- Binaries and libraries information
sonar.binaries=target/scala-2.10/classes
sonar.libraries=<tons of relative paths to relevant .jars>
我在使用和不使用sonar.libraries声明时遇到此错误。
答案 0 :(得分:0)
因为我的声誉是&lt; 50我只能发表答案而不发表评论......
在你工作之前,你有没有和你的声纳跑步者做过什么? 如果没有,你应该检查你的sonar-runner.properties并填写所需的东西。 例如,在我的公司,我们填写了以下内容(使用oracle databand或jbdc):
sonar.host.url,sonar.jbdc.url,sonar.jdbc.username,sonar.jdbc.password,sonar.jdbc.driver,sonar.login,sonar.password,sonar.sourceEncoding,...