artwood
artwood

Reputation: 1

How to set the mandatory properties sources for Sonar in Jenkins

Hello I've a problem with the configuration of jenkins in order to use the plugin of Sonar. I've set the properties into the file sonar-project.properties, that looks like the following code:

pom.groupId=groupID
pom.artifactId=artifactID

sonar.sourceEncoding=iso-8859-15
sonar.java.target=1.5
sonar.java.source=1.5
sonar.projectKey=projectkey
sonar.projectName= projectname
sonar.projectVersion=1.0.0

While I'm trying to do the building I got the following error in the console of Jenkins:

Exception in thread "main" org.sonar.runner.RunnerException: You must define mandatory properties: sources
    at org.sonar.runner.Runner.checkMandatoryProperties(Runner.java:92)
    at org.sonar.runner.Runner.execute(Runner.java:75)
    at org.sonar.runner.Main.main(Main.java:61)
Build step '**** custom Sonar analysis' marked build as failure
Finished: FAILURE

Do you have any suggestion? Where do I set this properties? Thanks in advance.

Upvotes: 0

Views: 2264

Answers (1)

"sonar.sources" property is mandatory: it tells SonarQube where your source files are located.

Everything is explained in the online documentation:

Upvotes: 1

Related Questions