gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 207 forks source link

Update Maven examples with locked down version of maven plugin #101

Open alixwar opened 6 years ago

alixwar commented 6 years ago

Instead of:

mvn sonar:sonar

do:

mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar

Source: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven

gabrie-allaigre commented 6 years ago

Hi, Yes, I use this configuration for my projects org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar Show here https://github.com/gabrie-allaigre/sonar-gitlab-plugin/blob/master/.gitlab-ci.yml

alixwar commented 6 years ago

Hi,

I was thinking about the code examples in README.md:

mvn --batch-mode verify sonar:sonar ...

gabrie-allaigre commented 6 years ago

In https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven

mvn clean verify sonar:sonar

# In some situation you may want to run sonar:sonar goal as a dedicated step. Be sure to use install as first step for multi-module projects
mvn clean install
mvn sonar:sonar

# Specify the version of sonar-maven-plugin instead of using the latest. See also 'How to Fix Version of Maven Plugin' below.
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar

sonar:sonar work normally