Latest 3.3 sonar-maven-plugin and 5.6 LTS as web server.
Running sonar analysis with mvn sonar:sonar
( Scanner for Maven )
ignores sonar-project.properties
file. (with many parameters https://docs.sonarqube.org/display/SONAR/Analysis+Parameters)
Is it that the expected behavior?
So do I have to configure all sonar parameters within pom.xml
files?
That is correct: the scanner for Maven ignores the
sonar-project.properties
file.To pass analysis parameters when using the scanner for Maven, set them as
<properties>
in thepom.xml
, for example:Or, you could also pass parameters using
-D
on the command line, for example:Other way would be to configure reading via Maven Properties Plugin
Q&A