简体   繁体   中英

SonarQube is using pom.xml and ignoring sonar-project.properties file

I have a Spring Boot application that is using a local instance of SonarQube to analyse the code. I need configure some file exclusions. If a set the exclusion on pom.xml it works fine, example:

<sonar.exclusions> **/services/MyClass.java </sonar.exclusions>

But if a try using sonar-project.properties it not works, example:

sonar.exclusions=**/services/MyClass.java

Should I need some extra configuration in order to use the sonar-project.properties file?

I did this test using sonarqube-scanner-maven project.

If you're using the "sonar:sonar" goal, it will use the Maven pom.xml. You should ensure your properties are set properly in the pom.xml. It is not useful to try to set these properties in an external file if you are using the Maven plugin.

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