3

mvn sonar:sonar を使用して、Java Maven プロジェクトのコード統計にローカル ソナー 3.5.1 を使用しています。しかし今、私は同じためにソナーランナーを使いたいです。そのため、sonar-runner 2.3 をインストールし、Ubuntu $PATH 変数に設定して、sonar-runner -h を使用してテストできるようになりました。プロジェクトのルート ディレクトリに sonar-project.properties を追加しました。このファイルの内容は次のようになります

# required metadata
sonar.projectKey=netsgear:analytix
sonar.projectName=analytix
sonar.projectVersion=1.0

# optional description
sonar.projectDescription=application analysis

# path to source directories (required)
sonar.sources=srcDir1,srcDir2

# The value of the property must be the key of the language.
sonar.language=java

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# Additional parameters
sonar.my.property=value

ソナーは localhost://9000 で実行されています。しかし、プロジェクトディレクトリから「sonar-runner」を実行すると例外がスローされ、sonar-runner -Xの出力は

INFO: SonarQube Server 3.5.1
13:06:50.497 ERROR rojectReactorBuilder - Invalid value of sonar.sources for 
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.483s
Final Memory: 3M/119M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:90)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:41)
Caused by: java.lang.IllegalStateException: The folder 'srcDir1' does not exist for  (base directory = /home/workspace/core)
    at org.sonar.runner.batch.ProjectReactorBuilder.checkExistenceOfDirectories(ProjectReactorBuilder.java:475)
    at org.sonar.runner.batch.ProjectReactorBuilder.cleanAndCheckModuleProperties(ProjectReactorBuilder.java:370)
    at org.sonar.runner.batch.ProjectReactorBuilder.cleanAndCheckProjectDefinitions(ProjectReactorBuilder.java:353)
    at org.sonar.runner.batch.ProjectReactorBuilder.build(ProjectReactorBuilder.java:130)
    at org.sonar.runner.batch.IsolatedLauncher.createBatch(IsolatedLauncher.java:60)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    ... 9 more

レゾナンスがわかりますか

4

1 に答える 1