Upgrade from 2.x to 3.x
Version 3.0 removed support for
SonarRunner,
Maven 2
Gradle sonarRunner
sonar4bamboo.inclusions.filepath
In case you use any of the removed features, follow these steps to upgrade.
SonarRunner
In case you are using a SonarRunner
task in your build, follow these steps:
Running 2.x, Preparing to Upgrade to 3.x
Install Sonar Scanner on Bamboo and Bamboo agents. Ensure you add the Sonar Scanner capability on.
Edit the projects Bamboo build. Add a new
Sonar Scanner
task.Copy the settings from the old
Sonar Runner
to theSonar Scanner
task.Delete the old
Sonar Runner
tasks.
Already Migrated to 3.x
You will get this error:
Could not execute task 'Your Task Name' no Plugin with key 'ch.mibex.bamboo.sonar4bamboo:sonar4bamboo.maven2task' is installed.Edit the Build Plan, you see the old task:
Create a
Sonar Scanner
replacement taskIf you do not remember some special value, you can look at the old tasks value via Bamboo specs:
Finally, delete the old
Sonar Runner
task.
Maven 2
Running 2.x, Preparing to Upgrade to 3.x
In case you are using a Sonar Maven 2
task in your build, follow these steps:
Upgrade your projects build to use Maven 3.
Edit the projects Bamboo build. Add a new
Sonar Maven 3
task.Copy the settings from the old
Sonar Maven 2
to theSonar Maven 3
taskDelete the old
Sonar Maven 2
tasks.
Already Migrated to 3.x
In case you already migrated to version 3.x, but still had a Sonar Maven 2
task.
You will get this error:
Could not execute task '' no Plugin with key 'ch.mibex.bamboo.sonar4bamboo:sonar4bamboo.maven2task' is installed.Edit the Build Plan, you see the old task:
Create a
Sonar Maven 3
replacement taskIf you do not remember some special value, you can look at the old tasks value via Bamboo specs:
Finally, delete the old
Sonar Maven 3
task.
Gradle SonarRunner
Running 2.x, Preparing to Upgrade to 3.x
In case you are using a Gradle Sonar Runner task in your build, follow these steps:
In you projects Gradle
build.gradle
file, remove the SonarRunner pluginAdd the Gradle Sonar Scanner to your projects
build.gradle
fileCheck the `
Use the new Gradle SonarQube plug-in instead of the deprecated Gradle SonarRunner plug-in
` option on the Sonar Gradle task:Save the changed settings
Already Migrated to 3.x
If didn’t migrate yet, you will get this error:
com.atlassian.bamboo.task.TaskException: Gradle sonarRunner is not supported anymore. Upgrade to Gradle Sonarqube plugin: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-gradle/ . Contact https://support.mibexsoftware.com if you need assistance
In you projects Gradle
build.gradle
file, remove the Sonarrunner pluginAdd the Gradle Sonar Scanner to your projects
build.gradle
fileOpen the build plan for that project.
Open the
Sonar Gradle
task.Save it again. Saving it will remove the old configuration options.
-Dsonar4bamboo.inclusions.filepath Property
The -Dsonar4bamboo.inclusions.filepath
has no replacement. The build will using the regular Sonar -Dsonar.inclusions
property of a full build instead.
Running 2.x, Preparing to Upgrade to 3.x
If a task is using the
Write the inclusion file list to a file (DEPRECATED
, uncheck it and save the changes:Remove the support for the
sonar4bamboo.inclusions.filepath
property from your build scriptsThe build should continue to work. The plugin will use the Sonar
-Dsonar.inclusions
flag instead of fall back to a full sonar scan
Already Migrated to 3.x
When you already migrated to 3.x, and you had the sonar4bamboo.inclusions.filepath
enabled, the build will give following warning:
09-Aug-2021 14:27:30 SONAR4BAMBOO: Writing a temporary inclusion file with the '-Dsonar4bamboo.inclusions.filepath' is not supported anymore.
09-Aug-2021 14:27:30 SONAR4BAMBOO: To remove this warning, edit the task and save it again. See also https://mibexsoftware.atlassian.net/wiki/spaces/SONARBAMBOO/pages/3023962113/Upgrade+from+2.x+to+3.x
09-Aug-2021 14:27:30 SONAR4BAMBOO: Build continues with Sonar's -Dsonar.inclusions instead of -Dsonar4bamboo.inclusions.filepath
To remove the warning:
Edit the build plan
Open the Sonar task and save it again.
The warning will gone after than and the task will use -Dsonar.inclusions
SONAR™, SONARQUBE™ and SONARCLOUD™ are independent and trademarked products and services of SonarSource SA: see sonarsource.com, sonarqube.org, sonarcloud.io.