ソナーでPHPプロジェクトを分析したい。PHP プラグインと PHPunit をインストールし、必要なすべての情報を含む sonar-project.properties ファイルを作成しました。実行には Java ランナーを使用します。私の問題に対して何百もの可能な解決策を試しましたが、何もうまくいきません。私はいつもこのエラーを受け取ります:
Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: Can't read PhpUnit report : /var/www/smc/.sonar/target/logs/phpunit.xml
at org.sonar.runner.Runner.delegateExecution(Runner.java:189)
at org.sonar.runner.Runner.execute(Runner.java:78)
at org.sonar.runner.Main.main(Main.java:61)
Caused by: org.sonar.api.utils.SonarException: Can't read PhpUnit report : /var/www/smc/.sonar/target/logs/phpunit.xml
at org.sonar.plugins.php.phpunit.PhpUnitResultParser.getTestSuites(PhpUnitResultParser.java:103)
at org.sonar.plugins.php.phpunit.PhpUnitResultParser.parseFile(PhpUnitResultParser.java:158)
at org.sonar.plugins.php.phpunit.PhpUnitResultParser.parse(PhpUnitResultParser.java:145)
at org.sonar.plugins.php.phpunit.PhpUnitSensor.analyse(PhpUnitSensor.java:72)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:102)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.Batch.execute(Batch.java:104)
at org.sonar.runner.Launcher.executeBatch(Launcher.java:65)
at org.sonar.runner.Launcher.execute(Launcher.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.Runner.delegateExecution(Runner.java:186)
... 2 more
Caused by: java.io.FileNotFoundException: /var/www/smc/.sonar/target/logs/phpunit.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.sonar.plugins.php.phpunit.PhpUnitResultParser.getTestSuites(PhpUnitResultParser.java:98)
... 22 more
これは私のプロパティファイルです:
# required metadata
sonar.projectKey=my:project
sonar.projectName=Social Media Connector
sonar.projectVersion=1.0
# path to source directories (required)
sources=htdocs/website/controllers
# path to test source directories (optional)
#tests=htdocs/website/controllers/tests
#sonar.phpUnit.mainTestClass=htdocs/website/controllers/tests/website/controllers/blubbTest.php
# path to project binaries (optional), for example directory of Java bytecode
#binaries=binDir
# optional comma-separated list of paths to libraries. Only path to JAR file and path to directory of classes are supported.
#libraries=path/to/library.jar,path/to/classes/dir
# Uncomment those lines if some features of java 5 or java 6 like annotations, enum, ...
# are used in the source code to be analyzed
#sonar.java.source=1.5
#sonar.java.target=1.5
# Uncomment this line to analyses a project which is not a java project.
# The value of the property must be the key of the language.
sonar.language=php
# Advanced parameters
#my.property=value
#sonar.phpUnit.skip=true
sonar.phpUnit.analyze.test.directory=true
何か案は?