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.
Openrewrite runs as a Maven plugin. The easiest way to run the recipe is to add a new Maven profile to your POM file.
1 2<profile> <id>openrewrite</id> <build> <plugins> <plugin> <groupId>org.openrewrite.maven</groupId> <artifactId>rewrite-maven-plugin</artifactId> <version>5.15.4</version> <!-- This version can be newer if you want --> <configuration> <!-- This tag ensures that we first do a dry run on all modules, before doing a real run. --> <failOnDryRunResults>true</failOnDryRunResults> </configuration> <dependencies> <dependency> <groupId>org.openrewrite.recipe</groupId> <artifactId>rewrite-migrate-java</artifactId> <!-- Ensure this uses the latest version, especially when running standard recipes --> <version>2.8.0</version> </dependency> <dependency> <groupId>com.atlassian.platform</groupId> <artifactId>openrewrite-recipes</artifactId> <!-- Replace this with the latest version of the openrewrite-recipes dependency --> <version>${platform.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> </profile>
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.
1 2mvn clean install -DskipTests
After that, you can run a recipe using
1 2mvn -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.
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:
getUrlFor
refactor in RestUrlBuilder
;@javax.inject.Inject
annotation to resolve dependencies.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: