I am trying to integrate SonarQube
to generate report on my iOS project
,
I am using Objective-C Sonar plugin
When i run ./run-sonar.sh
OCLint
generates a compile_commands.json
file in my root directory.
and after that getting following error
11:24:39.782 INFO - Processing OCLint report /Users/.......app/./sonar-reports/oclint.xml
11:24:39.899 ERROR - Reporting 1073 violations.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 16.240s
Final Memory: 6M/86M
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:100)
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:53)
Caused by: The rule 'OCLint:ivar assignment outside accessors or init' does not exist.
Can any one help me on this issue? Thanks AMR
Thnaks
I am not sure what version of the objective-c-sonar plugin that you were using. I solved similar issue before.
Goto
${SONAR_INSTALLATION_FOLDER}/extensions/plugins/
, copy thesonar-objective-c-plugin-${version}.jar
to somewhere else.unzip the jar file, and edit below file
org/sonar/plugins/objectivec/profile-oclint.xml
Add the rule you are missing following the layout of the xml file,
may be look similar below
And edit another file
org/sonar/plugins/objectivec/rules-oclint.xml
And then using zip to package the files unpacked as the new jar file. Override the original plugin jar file in
${SONAR_INSTALLATION_FOLDER}/extensions/plugins/
, restart the sonar, issue could be gone.Repeat the step for all similar issues you encountered.