Maven

Configuration

Configure the Maven project to use the Sonar™Scanner as shown in the SonarQube™ Wiki.

See the official Maven example for inspiration

[optional: code coverage] Add a Maven task to your Bamboo job:

Run the tests and generate code coverage reports:

clean org.jacoco:jacoco-maven-plugin:prepare-agent verify

Add a Sonar™Scanner for Maven task to your Bamboo job:

image-20240906-150453.png

Tips & Troubleshooting

If you use Sonar™Scanner Maven task on a remote agent, set the Maven capability by

  • adding a Maven capability to your remote agent in the Bamboo UI

  • or add the following key/value pair to your bamboo-agent-home/bin/bamboo-capabilities.properties file, see Bamboo docs for more details:

    system.builder.mvn3.Maven3=path/to/your/maven3/home

The 'Maven3' part is the executable label.

 

SONAR™, SONARQUBE™ and SONARCLOUD™ are independent and trademarked products and services of SonarSource SA: see sonarsource.com, sonarqube.org, sonarcloud.io.