Links

Migrate Hibernate dependencies to 6.1.x

org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61 _This recipe will migrate any existing dependencies on Hibernate 5.x to the latest 6.1.x release. This migration will include the adjustment to the new org.hibernate.orm group ID. It accounts for artifacts names that both do and do not include the jakarta suffix and it will change both dependencies and managed dependencies. _

Source

  • groupId: org.openrewrite.recipe
  • artifactId: rewrite-migrate-java
  • version: 1.16.0

Usage

This recipe has no required configuration options and can be activated directly after taking a dependency on org.openrewrite.recipe:rewrite-migrate-java:1.16.0 in your build file:
Gradle
Maven POM
Maven Command Line
build.gradle
plugins {
id("org.openrewrite.rewrite") version("5.34.0")
}
rewrite {
activeRecipe("org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-migrate-java:1.16.0")
}
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.39.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>1.16.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
shell
mvn org.openrewrite.maven:rewrite-maven-plugin:4.39.0:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:1.16.0 \
-DactiveRecipes=org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipes=org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61

Definition

Recipe List
Yaml Recipe List
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.hibernate.MigrateToHibernateDependencies61
displayName: Migrate Hibernate dependencies to 6.1.x
description: This recipe will migrate any existing dependencies on Hibernate 5.x to the latest 6.1.x release. This migration will include the adjustment to the new `org.hibernate.orm` group ID. It accounts for artifacts names that both do and do not include the `jakarta` suffix and it will change both dependencies and managed dependencies.
recipeList:
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-agroal
newGroupId: org.hibernate.orm
newArtifactId: hibernate-agroal
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-agroal-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-agroal
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-agroal
newGroupId: org.hibernate.orm
newArtifactId: hibernate-agroal
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-agroal-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-agroal
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-c3p0
newGroupId: org.hibernate.orm
newArtifactId: hibernate-c3p0
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-c3p0-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-c3p0
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-c3p0
newGroupId: org.hibernate.orm
newArtifactId: hibernate-c3p0
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-c3p0-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-c3p0
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-community-dialects
newGroupId: org.hibernate.orm
newArtifactId: hibernate-community-dialects
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-community-dialects-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-community-dialects
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-community-dialects
newGroupId: org.hibernate.orm
newArtifactId: hibernate-community-dialects
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-community-dialects-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-community-dialects
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-core
newGroupId: org.hibernate.orm
newArtifactId: hibernate-core
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-core-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-core
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-core
newGroupId: org.hibernate.orm
newArtifactId: hibernate-core
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-core-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-core
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-envers
newGroupId: org.hibernate.orm
newArtifactId: hibernate-envers
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-envers-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-envers
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-envers
newGroupId: org.hibernate.orm
newArtifactId: hibernate-envers
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-envers-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-envers
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-graalvm
newGroupId: org.hibernate.orm
newArtifactId: hibernate-graalvm
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-graalvm-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-graalvm
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-graalvm
newGroupId: org.hibernate.orm
newArtifactId: hibernate-graalvm
newVersion: 6.1.x
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-graalvm-jakarta
newGroupId: org.hibernate.orm
newArtifactId: hibernate-graalvm
newVersion: 6.1.x
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: org.hibernate
oldArtifactId: hibernate-hikaricp
newGroupId: org.hibernate.orm