Last updated Jun 11, 2024

Using OpenRewrite to automate Platform 7 migrations


To help with migrating some of the (breaking) changes introduced in DC Platform 7, which are rolled out as part of major releases across DC Products, we have developed some openrewrite recipes that can automate some of the repetitive changes. These recipes are published here

These recipes were developed as an experimental internal tool. We are releasing these as a courtesy to our partners, since we have seen great success using them ourselves. We will make best-effort attempts to address any problems you may run into, but these recipes do not have an official support status.

Getting started

Openrewrite runs as a Maven plugin. The easiest way to run the recipe is to add a new Maven profile to your POM file.

        <version>5.15.4</version> <!-- This version can be newer if you want -->
          <!-- This tag ensures that we first do a dry run on all modules, before doing a real run. -->
            <!-- Ensure this uses the latest version, especially when running standard recipes -->
            <!-- Replace this with the latest version of the openrewrite-recipes dependency -->

Before running the recipe, it is recommended to first run a mvn install on your project. This ensures the dependencies are correctly pulled in, since sometimes this can cause problems.

mvn clean install -DskipTests

After that, you can run a recipe using

mvn -Popenrewrite rewrite:run -Drewrite.activeRecipes=com.package.Recipe

Replace com.package.Recipe with the package name of your recipe to run.

This command will make the changes in place. It is recommended you manually validate the changes before creating a PR.

Available recipes

Covers atlassian-sal upgrade guide.

Covers security features and RestUrlBuilder.

AnonymousAllowed is migrated to AnonymousSiteAccess as it is the more 'restrictive'. If you actually want UnrestrictedAccess - you will need to make the changes manually

Currently does not include:

Covers activeobjects upgrade guide

Covers dom4j to in-house Element migration within module descriptors only. See upgrade guide.

Covers the package restructuring changes in atlassian-plugins. See upgrade guide.

Covers moved types in webfragments. Does not address calls to now inaccessible API.

Covers moved types in webfragments. Does not address calls to now inaccessible API.

Rate this page: