简体   繁体   中英

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.

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

Everything is explained in the online documentation:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM