I want to parse a PHP project using sonar. I installed PHP-Plugin and PHPunit and created the sonar-project.properties file with all the necessary information. I use Java-runner to execute. I tried hundreds of possible solutions for my problem, but nothing works. I always get this error:
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
This is my properties file:
sonar.projectKey=my:project
sonar.projectName=Social Media Connector
sonar.projectVersion=1.0
sources=htdocs/website/controllers
sonar.language=php
sonar.phpUnit.analyze.test.directory=true
Any ideas?
source
share