Upgrade from 2.x to 3.x

Version 3.0 removed support for

  1. SonarRunner,

  2. Maven 2

  3. Gradle sonarRunner

  4. 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

  1. Install Sonar Scanner on Bamboo and Bamboo agents. Ensure you add the Sonar Scanner capability on.

  2. Edit the projects Bamboo build. Add a new Sonar Scanner task.

  3. Copy the settings from the old Sonar Runner to the Sonar Scanner task.

  4. Delete the old Sonar Runner tasks.

Already Migrated to 3.x

  1. You will get this error:
    Could not execute task 'Your Task Name' no Plugin with key 'ch.mibex.bamboo.sonar4bamboo:sonar4bamboo.maven2task' is installed.

  2. Edit the Build Plan, you see the old task:

  3. Create a Sonar Scanner replacement task

  4. If you do not remember some special value, you can look at the old tasks value via Bamboo specs:

  5. 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:

  1. Upgrade your projects build to use Maven 3.

  2. Edit the projects Bamboo build. Add a new Sonar Maven 3 task.

  3. Copy the settings from the old Sonar Maven 2 to the Sonar Maven 3 task

  4. Delete 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.

  1. You will get this error:
    Could not execute task '' no Plugin with key 'ch.mibex.bamboo.sonar4bamboo:sonar4bamboo.maven2task' is installed.

  2. Edit the Build Plan, you see the old task:

  3. Create a Sonar Maven 3 replacement task

  4. If you do not remember some special value, you can look at the old tasks value via Bamboo specs:

  5. 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:

  1. In you projects Gradle build.gradle file, remove the SonarRunner plugin

  2. Add the Gradle Sonar Scanner to your projects build.gradle file

  3. Check the `Use the new Gradle SonarQube plug-in instead of the deprecated Gradle SonarRunner plug-in` option on the Sonar Gradle task:

  4. Save the changed settings

Already Migrated to 3.x

  1. 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

  2. In you projects Gradle build.gradle file, remove the Sonarrunner plugin

  3. Add the Gradle Sonar Scanner to your projects build.gradle file

  4. Open the build plan for that project.

  5. Open the Sonar Gradle task.

  6. 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

  1. If a task is using the Write the inclusion file list to a file (DEPRECATED, uncheck it and save the changes:

     

  2. Remove the support for the sonar4bamboo.inclusions.filepath property from your build scripts

  3. The 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:

  1. Edit the build plan

  2. 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.