1
votes

I'm having a hard time figuring out how to fix this error I'm getting with the Sonar Runner on the Jenkins build server. It's worked fine for me up until today. I haven't changed any settings or files. Does anyone know what I need to do to get this running again?

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:79) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71) at org.sonar.runner.api.Runner.execute(Runner.java:89) 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: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion at org.sonar.runner.batch.ProjectReactorBuilder.checkMandatoryProperties(ProjectReactorBuilder.java:314) at org.sonar.runner.batch.ProjectReactorBuilder.defineProject(ProjectReactorBuilder.java:130) at org.sonar.runner.batch.ProjectReactorBuilder.build(ProjectReactorBuilder.java:118) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75) ... 9 more

1

1 Answers

2
votes

I think it's due to your sonar-project.properties file. It is located at the root of your project. Check if it contains enough (mandatory) information, like, in your case:

  • sonar.projectKey
  • sonar.projectName
  • sonar.projectVersion

Your can find more help on the documentation