org.openrewrite.java.migrate.UpgradePluginsForJava11
Updates plugins to version compatible with Java 11.
Tags
Recipe source
GitHub: java-version-11.yml, Issue Tracker, Maven Central
info
This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.
This recipe is available under the Moderne Source Available License.
Definition
- Recipe List
- Yaml Recipe List
- Upgrade Maven plugin version
- groupId:
org.apache.maven.plugins - artifactId:
maven-compiler-plugin - newVersion:
3.6.2 - addVersionIfMissing:
true
- groupId:
- Upgrade
actions/setup-javajava-version- minimumJavaMajorVersion:
11
- minimumJavaMajorVersion:
- Upgrade Maven plugin version
- groupId:
ro.isdc.wro4j - artifactId:
wro4j-maven-plugin - newVersion:
1.10.1
- groupId:
- Upgrade Maven plugin version
- groupId:
org.codehaus.mojo - artifactId:
jaxb2-maven-plugin - newVersion:
2.5.x
- groupId:
- Upgrade Maven plugin version
- groupId:
org.jvnet.jaxb - artifactId:
jaxb-maven-plugin - newVersion:
2.0.X
- groupId:
Used by
This recipe is used as part of the following composite recipes:
Examples
Example 1
Java8toJava11Test#needToJaxb2MavenPlugin
Unchanged
Unchanged
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.3.1</version>
</plugin>
</plugins>
</build>
</project>
Example 2
UpgradeWro4jMavenPluginVersionTest#v1OnJava11
- pom.xml
- Diff
Before
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<properties>
<wro4j.version>1.8.0</wro4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
</plugin>
</plugins>
</build>
</project>
After
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<properties>
<wro4j.version>1.10.1</wro4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
</plugin>
</plugins>
</build>
</project>
Example 3
Java8toJava11Test#needToJaxb2MavenPlugin
Unchanged
Unchanged
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.3.1</version>
</plugin>
</plugins>
</build>
</project>
Example 4
UpgradeWro4jMavenPluginVersionTest#v1OnJava11
- pom.xml
- Diff
Before
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<properties>
<wro4j.version>1.8.0</wro4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
</plugin>
</plugins>
</build>
</project>
After
pom.xml
<project>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<properties>
<wro4j.version>1.10.1</wro4j.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
</plugin>
</plugins>
</build>
</project>
Usage
This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite.recipe:rewrite-migrate-java` in your build file or by running a shell command (in which case no build changes are needed):
- Gradle
- Gradle init script
- Maven POM
- Maven Command Line
- Moderne CLI
- Add the following to your
build.gradlefile:build.gradle
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.java.migrate.UpgradePluginsForJava11")
setExportDatatables(true)
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.31.1")
} - Run
gradle rewriteRunto run the recipe.
See how this recipe works across multiple open-source repositories

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.
Data Tables
- SourcesFileResults
- SearchResults
- SourcesFileErrors
- RecipeRunStats
- MavenMetadataFailures
Source files that had results
org.openrewrite.table.SourcesFileResults
Source files that were modified by the recipe run.
| Column Name | Description |
|---|---|
| Source path before the run | The source path of the file before the run. null when a source file was created during the run. |
| Source path after the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. |
| Recipe that made changes | The specific recipe that made a change. |
| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. |
| Cycle | The recipe cycle in which the change was made. |