Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,708
Community Members
 
Community Events
168
Community Groups

Using non-default sonar-maven-plugin version

Hi,

I am having an issue I can't find a solution for.

I use:
Bamboo Version 7.0.3 Build number 70016
Sonar for Bamboo Version:3.1.1
JRE version 1.8.0_202-b08
sonarcloud.io

From a bamboo job I am successfully running Sonar Gradle task (Gradle 5.6.4/Zulu JDK 11.35.15)

Now with Sonar Maven 3 task I get this error

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project hema-full-project: Unable to execute SonarQube: Fail to download libraries from server: Index 1 out of bounds for length 1 -> [Help 1]

I learned that this is a miss match between sonar-maven-plugin 3.0.2 and the sonarcloud.io API

I learned that the target sonar:sonar is part of maven and resolves automatically
https://stackoverflow.com/questions/14979530/why-does-the-maven-command-mvn-sonarsonar-work-without-any-plugin-configurati 

So when I run this command from the bamboo server directly it ends ANALYSIS SUCCESSFUL;

/opt/apache-maven-3.2.3/bin/mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar -D....

Regardless of which maven version I use 3.2.3/3.5.4 Sonar Maven 3 task uses/resolves to sonar-maven-plugin:3.0.2:sonar

How to ensure Sonar Maven 3 using sonar-maven-plugin:3.9.0 ?

Regards,
Corné

1 answer

1 accepted

0 votes
Answer accepted

I should be reading documentation more closely
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/#header-7

For future references

<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.0.2155</version>
</plugin>


Love Corné

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events