diff --git a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreTestUtil.java b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreTestUtil.java index ace7a1c8d4..56941e6e86 100644 --- a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreTestUtil.java +++ b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreTestUtil.java @@ -15,6 +15,7 @@ import org.openrewrite.config.CompositeRecipe; import org.openrewrite.config.Environment; import org.openrewrite.config.YamlResourceLoader; +import org.openrewrite.maven.UpgradeDependencyVersion; import org.openrewrite.maven.ChangePropertyValue; import org.openrewrite.test.RecipeSpec; @@ -51,8 +52,8 @@ public static RecipeSpec recipe(RecipeSpec spec, Path recipeFile, String quarkus } private static Recipe updateQuarkus(String quarkusVersion) { - return new CompositeRecipe(List.of(new ChangePropertyValue("quarkus.version", quarkusVersion, null, null), - new ChangePropertyValue("quarkus.platform.version", quarkusVersion, null, null))); + return new CompositeRecipe(List.of(new UpgradeDependencyVersion("io.quarkus.platform", "quarkus-bom", quarkusVersion, null, null, null), + new UpgradeDependencyVersion("io.quarkus", "quarkus-bom", quarkusVersion, null, null, null))); } private static Recipe recipeFromResource(String yamlResource, String... activeRecipes) { diff --git a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate37Test.java b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate37Test.java index 715dca9551..baa112ff0b 100644 --- a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate37Test.java +++ b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate37Test.java @@ -4,7 +4,6 @@ import java.nio.file.Path; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; @@ -15,7 +14,7 @@ public class CoreUpdate37Test implements RewriteTest { @Override public void defaults(RecipeSpec spec) { - CoreTestUtil.recipe(spec, Path.of("quarkus-updates", "core", "3.7.alpha1.yaml"), "3.7.0") + CoreTestUtil.recipe(spec, Path.of("quarkus-updates", "core", "3.7.alpha1.yaml"), "3.7.0.CR1") .parser(JavaParser.fromJavaVersion().logCompilationWarningsAndErrors(true)) .typeValidationOptions(TypeValidation.none()); } @@ -429,7 +428,7 @@ void testJpaModelgenNewDependencyManagedByQuarkusBom() { io.quarkus quarkus-bom - 3.6.4 + 3.7.0.CR1 pom import @@ -446,6 +445,7 @@ void testJpaModelgenNewDependencyManagedByQuarkusBom() { org.hibernate.orm hibernate-jpamodelgen + 6.4.1.Final @@ -701,7 +701,7 @@ void testJpaModelgenOldJpaModelgenAnnotationProcessorAlreadyPresent() { io.quarkus quarkus-bom - 3.6.4 + 3.7.0.CR1 pom import @@ -718,6 +718,7 @@ void testJpaModelgenOldJpaModelgenAnnotationProcessorAlreadyPresent() { org.hibernate.orm hibernate-jpamodelgen + 6.4.1.Final @@ -786,7 +787,92 @@ void testJpaModelgenOldJpaModelgenAnnotationProcessorAlreadyPresentWithOutdatedV io.quarkus quarkus-bom - 3.6.4 + 3.7.0.CR1 + pom + import + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.12.1 + + + + org.hibernate.orm + hibernate-jpamodelgen + 6.4.1.Final + + + + + + + + """)); + } + + @Test + void testSyncVersion() { + //language=xml + rewriteRun(pomXml(""" + + 4.0.0 + io.quarkus.bot + release + 999-SNAPSHOT + + 3.6.4 + + + + + io.quarkus + quarkus-bom + ${quarkus.version} + pom + import + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.12.1 + + + + org.hibernate.orm + hibernate-jpamodelgen + 6.2.13.Final + + + + + + + + """, + """ + + 4.0.0 + io.quarkus.bot + release + 999-SNAPSHOT + + 3.7.0.CR1 + + + + + io.quarkus + quarkus-bom + ${quarkus.version} pom import @@ -803,6 +889,7 @@ void testJpaModelgenOldJpaModelgenAnnotationProcessorAlreadyPresentWithOutdatedV org.hibernate.orm hibernate-jpamodelgen + 6.4.1.Final @@ -814,7 +901,6 @@ void testJpaModelgenOldJpaModelgenAnnotationProcessorAlreadyPresentWithOutdatedV } @Test - @Disabled("Pending the release of 3.7.0") void testResteasyClientRenaming() { //language=xml rewriteRun(pomXml(""" @@ -868,7 +954,7 @@ void testResteasyClientRenaming() { release 999-SNAPSHOT - 3.7.0 + 3.7.0.CR1 diff --git a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate39Test.java b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate39Test.java index a24d872afe..58dada6036 100644 --- a/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate39Test.java +++ b/recipes-unit-tests/src/test/java/io/quarkus/updates/core/CoreUpdate39Test.java @@ -4,7 +4,6 @@ import java.nio.file.Path; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; diff --git a/recipes/src/main/java/io/quarkus/updates/core/quarkus37/AddMavenCompilerAnnotationProcessor.java b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/AddMavenCompilerAnnotationProcessor.java index 52b69e727f..c0820427a4 100644 --- a/recipes/src/main/java/io/quarkus/updates/core/quarkus37/AddMavenCompilerAnnotationProcessor.java +++ b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/AddMavenCompilerAnnotationProcessor.java @@ -9,7 +9,10 @@ import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; +import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenVisitor; +import org.openrewrite.maven.tree.MavenResolutionResult; +import org.openrewrite.maven.tree.ResolvedManagedDependency; import org.openrewrite.xml.tree.Xml; import lombok.EqualsAndHashCode; @@ -25,6 +28,10 @@ public class AddMavenCompilerAnnotationProcessor extends Recipe { @Option(displayName = "Annotation processor artifactId", description = "The artifactId of the annotation processor.", example = "hibernate-jpamodelgen", required = true) String artifactId; + @Option(displayName = "Enforce managed version", description = "If the new annotation processor has a managed version, this flag can be used to explicitly set the version on the annotation processor with the version of the managed dependency. The default for this flag is `false`.", required = false) + @Nullable + Boolean enforceManagedVersion; + @Override public String getDisplayName() { return "Add an annotation processor to the Maven Compiler plugin configuration"; @@ -48,6 +55,13 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { String annotationProcessorPath = "" + groupId + "\n" + artifactId + ""; + if (Boolean.TRUE.equals(enforceManagedVersion)) { + String managedVersion = getManagedVersion(groupId, artifactId); + if (managedVersion != null) { + annotationProcessorPath += "" + managedVersion + ""; + } + } + if (configuration.isPresent()) { Optional annotationProcessorPathsWrapper = configuration.get() .getChild("annotationProcessorPaths"); @@ -79,6 +93,17 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { } return mavenCompilerPluginTag; } + + private String getManagedVersion(String groupId, String artifactId) { + MavenResolutionResult result = getResolutionResult(); + for (ResolvedManagedDependency managedDependency : result.getPom().getDependencyManagement()) { + if (groupId.equals(managedDependency.getGroupId()) + && artifactId.equals(managedDependency.getArtifactId())) { + return managedDependency.getVersion(); + } + } + return null; + } }; } } diff --git a/recipes/src/main/java/io/quarkus/updates/core/quarkus37/ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId.java b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId.java index eb3e5a7331..01a76f954d 100644 --- a/recipes/src/main/java/io/quarkus/updates/core/quarkus37/ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId.java +++ b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId.java @@ -19,7 +19,6 @@ import org.openrewrite.maven.tree.MavenMetadata; import org.openrewrite.maven.tree.MavenResolutionResult; import org.openrewrite.maven.tree.ResolvedManagedDependency; -import org.openrewrite.maven.tree.Scope; import org.openrewrite.semver.Semver; import org.openrewrite.semver.VersionComparator; import org.openrewrite.xml.AddToTagVisitor; @@ -65,6 +64,10 @@ public class ChangeMavenCompilerAnnotationProcessorGroupIdAndArtifactId extends @Nullable Boolean overrideManagedVersion; + @Option(displayName = "Enforce managed version", description = "If the new annotation processor has a managed version, this flag can be used to explicitly set the version on the annotation processor with the version of the managed dependency. The default for this flag is `false`.", required = false) + @Nullable + Boolean enforceManagedVersion; + @Override public String getDisplayName() { return "Change Maven Compiler plugin annotation processor groupId, artifactId and/or the version"; @@ -130,39 +133,42 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { .orElseThrow(NoSuchElementException::new); } - if (newVersion != null) { + String versionToApply = Boolean.TRUE.equals(enforceManagedVersion) ? getManagedVersion(groupId, artifactId) : null; + if (versionToApply == null && newVersion != null) { try { - String resolvedNewVersion = resolveSemverVersion(ctx, groupId, artifactId); - Scope scope = Scope.Compile; - // starting with Maven Compiler plugin 3.12.0, the annotation processor versions will honor the dependency management - Optional versionTag = annotationProcessorPath.getChild("version"); - if (!versionTag.isPresent() && - (Boolean.TRUE.equals(overrideManagedVersion) - || !isDependencyManaged(groupId, artifactId))) { + versionToApply = resolveSemverVersion(ctx, groupId, artifactId); + } catch (MavenDownloadingException e) { + return e.warn(tag); + } + } + if (versionToApply != null) { + // starting with Maven Compiler plugin 3.12.0, the annotation processor versions will honor the dependency management + Optional versionTag = annotationProcessorPath.getChild("version"); + if (!versionTag.isPresent()) { + if ((Boolean.TRUE.equals(overrideManagedVersion) + || !isDependencyManaged(groupId, artifactId)) + || Boolean.TRUE.equals(enforceManagedVersion)) { //If the version is not present, add the version if we are explicitly overriding a managed version or if no managed version exists. Xml.Tag newVersionTag = Xml.Tag - .build("" + resolvedNewVersion + ""); + .build("" + versionToApply + ""); //noinspection ConstantConditions - mavenCompilerPluginTag = (Xml.Tag) new AddToTagVisitor( - annotationProcessorPath, newVersionTag, - new MavenTagInsertionComparator(annotationProcessorPath.getChildren())) - .visitNonNull(mavenCompilerPluginTag, ctx, - getCursor().getParent()); - } else if (versionTag.isPresent()) { - if (isDependencyManaged(groupId, artifactId) - && !Boolean.TRUE.equals(overrideManagedVersion)) { - //If the previous dependency had a version but the new artifact is managed, removed the - //version tag. - mavenCompilerPluginTag = (Xml.Tag) new RemoveContentVisitor<>(versionTag.get(), - false).visit(mavenCompilerPluginTag, ctx); - } else { - //Otherwise, change the version to the new value. - mavenCompilerPluginTag = changeChildTagValue(mavenCompilerPluginTag, annotationProcessorPath, - "version", resolvedNewVersion, ctx); - } + mavenCompilerPluginTag = AddToTagVisitor.addToTag( + mavenCompilerPluginTag, annotationProcessorPath, newVersionTag, + getCursor().getParent()); + } + } else { + if (isDependencyManaged(groupId, artifactId) + && !Boolean.TRUE.equals(overrideManagedVersion) + && !Boolean.TRUE.equals(enforceManagedVersion)) { + //If the previous dependency had a version but the new artifact is managed, removed the + //version tag. + mavenCompilerPluginTag = (Xml.Tag) new RemoveContentVisitor<>(versionTag.get(), + false).visit(mavenCompilerPluginTag, ctx); + } else { + //Otherwise, change the version to the new value. + mavenCompilerPluginTag = changeChildTagValue(mavenCompilerPluginTag, annotationProcessorPath, + "version", versionToApply, ctx); } - } catch (MavenDownloadingException e) { - return e.warn(tag); } } } @@ -177,9 +183,9 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { private Xml.Tag changeChildTagValue(Xml.Tag parentScope, Xml.Tag tag, String childTagName, String newValue, ExecutionContext ctx) { Optional childTag = tag.getChild(childTagName); if (childTag.isPresent() && !newValue.equals(childTag.get().getValue().orElse(null))) { - tag = (Xml.Tag) new ChangeTagValueVisitor<>(childTag.get(), newValue).visitNonNull(parentScope, ctx); + return (Xml.Tag) new ChangeTagValueVisitor<>(childTag.get(), newValue).visitNonNull(parentScope, ctx); } - return tag; + return parentScope; } private boolean isDependencyManaged(String groupId, String artifactId) { @@ -188,14 +194,27 @@ private boolean isDependencyManaged(String groupId, String artifactId) { for (ResolvedManagedDependency managedDependency : result.getPom().getDependencyManagement()) { if (groupId.equals(managedDependency.getGroupId()) && artifactId.equals(managedDependency.getArtifactId())) { - return Scope.Compile.isInClasspathOf(managedDependency.getScope()) || - Scope.Runtime.isInClasspathOf(managedDependency.getScope()) || - Scope.Provided.isInClasspathOf(managedDependency.getScope()); + return true; } } return false; } + private String getManagedVersion(String groupId, String artifactId) { + if (!isDependencyManaged(groupId, artifactId)) { + return null; + } + + MavenResolutionResult result = getResolutionResult(); + for (ResolvedManagedDependency managedDependency : result.getPom().getDependencyManagement()) { + if (groupId.equals(managedDependency.getGroupId()) + && artifactId.equals(managedDependency.getArtifactId())) { + return managedDependency.getVersion(); + } + } + return null; + } + @SuppressWarnings("ConstantConditions") private String resolveSemverVersion(ExecutionContext ctx, String groupId, String artifactId) throws MavenDownloadingException { diff --git a/recipes/src/main/java/io/quarkus/updates/core/quarkus37/SyncMavenCompilerAnnotationProcessorVersion.java b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/SyncMavenCompilerAnnotationProcessorVersion.java new file mode 100644 index 0000000000..d1ffba93ab --- /dev/null +++ b/recipes/src/main/java/io/quarkus/updates/core/quarkus37/SyncMavenCompilerAnnotationProcessorVersion.java @@ -0,0 +1,110 @@ +package io.quarkus.updates.core.quarkus37; + +import java.util.Optional; + +import org.openrewrite.ExecutionContext; +import org.openrewrite.Option; +import org.openrewrite.Recipe; +import org.openrewrite.TreeVisitor; +import org.openrewrite.maven.MavenTagInsertionComparator; +import org.openrewrite.maven.MavenVisitor; +import org.openrewrite.maven.table.MavenMetadataFailures; +import org.openrewrite.maven.tree.MavenResolutionResult; +import org.openrewrite.maven.tree.ResolvedManagedDependency; +import org.openrewrite.xml.AddToTagVisitor; +import org.openrewrite.xml.ChangeTagValueVisitor; +import org.openrewrite.xml.tree.Xml; + +import lombok.EqualsAndHashCode; +import lombok.Value; + +@Value +@EqualsAndHashCode(callSuper = true) +public class SyncMavenCompilerAnnotationProcessorVersion extends Recipe { + + @EqualsAndHashCode.Exclude + MavenMetadataFailures metadataFailures = new MavenMetadataFailures(this); + + @Option(displayName = "Annotation processor groupId", description = "The groupId of the annotation processor.", example = "org.hibernate.orm", required = true) + String groupId; + + @Option(displayName = "Annotation processor artifactId", description = "The artifactId of the annotation processor.", example = "hibernate-jpamodelgen", required = true) + String artifactId; + + @Override + public String getDisplayName() { + return "Sync Maven Compiler plugin annotation processor version with the one provided by the BOM"; + } + + @Override + public String getDescription() { + return "Sync Maven Compiler plugin annotation processor version with the one provided by the BOM."; + } + + @Override + public TreeVisitor getVisitor() { + + return new MavenVisitor() { + @Override + public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { + Xml.Tag mavenCompilerPluginTag = (Xml.Tag) super.visitTag(tag, ctx); + + if (isPluginTag("org.apache.maven.plugins", "maven-compiler-plugin")) { + Optional configuration = mavenCompilerPluginTag.getChild("configuration"); + if (configuration.isPresent()) { + Optional annotationProcessorPathsWrapper = configuration.get() + .getChild("annotationProcessorPaths"); + if (annotationProcessorPathsWrapper.isPresent()) { + Optional annotationProcessorPathCandidate = annotationProcessorPathsWrapper.get() + .getChildren().stream() + .filter(t -> groupId.equals(t.getChildValue("groupId").orElse(null)) + && artifactId.equals(t.getChildValue("artifactId").orElse(null))) + .findFirst(); + + if (annotationProcessorPathCandidate.isPresent()) { + Xml.Tag annotationProcessorPath = annotationProcessorPathCandidate.get(); + + String newVersion = getManagedVersion(groupId, artifactId); + if (newVersion != null) { + Optional versionTag = annotationProcessorPath.getChild("version"); + if (!versionTag.isPresent()) { + Xml.Tag newVersionTag = Xml.Tag + .build("" + newVersion + ""); + mavenCompilerPluginTag = AddToTagVisitor.addToTag( + mavenCompilerPluginTag, annotationProcessorPath, newVersionTag, + getCursor().getParent()); + } else { + mavenCompilerPluginTag = changeChildTagValue(mavenCompilerPluginTag, annotationProcessorPath, + "version", newVersion, ctx); + } + } + } + } + } + } + + //noinspection ConstantConditions + return mavenCompilerPluginTag; + } + + private Xml.Tag changeChildTagValue(Xml.Tag parentScope, Xml.Tag tag, String childTagName, String newValue, ExecutionContext ctx) { + Optional childTag = tag.getChild(childTagName); + if (childTag.isPresent() && !newValue.equals(childTag.get().getValue().orElse(null))) { + return (Xml.Tag) new ChangeTagValueVisitor<>(childTag.get(), newValue).visitNonNull(parentScope, ctx); + } + return parentScope; + } + + private String getManagedVersion(String groupId, String artifactId) { + MavenResolutionResult result = getResolutionResult(); + for (ResolvedManagedDependency managedDependency : result.getPom().getDependencyManagement()) { + if (groupId.equals(managedDependency.getGroupId()) + && artifactId.equals(managedDependency.getArtifactId())) { + return managedDependency.getVersion(); + } + } + return null; + } + }; + } +} diff --git a/recipes/src/main/java/io/quarkus/updates/core/quarkus39/RemoveMavenCompilerAnnotationProcessor.java b/recipes/src/main/java/io/quarkus/updates/core/quarkus39/RemoveMavenCompilerAnnotationProcessor.java index 0e8e9df724..6d60682d1c 100644 --- a/recipes/src/main/java/io/quarkus/updates/core/quarkus39/RemoveMavenCompilerAnnotationProcessor.java +++ b/recipes/src/main/java/io/quarkus/updates/core/quarkus39/RemoveMavenCompilerAnnotationProcessor.java @@ -1,6 +1,5 @@ package io.quarkus.updates.core.quarkus39; -import java.util.List; import java.util.Optional; import org.openrewrite.ExecutionContext; @@ -51,29 +50,19 @@ public Xml visitTag(Xml.Tag tag, ExecutionContext ctx) { Optional annotationProcessorPathsWrapper = configuration.get() .getChild("annotationProcessorPaths"); if (annotationProcessorPathsWrapper.isPresent()) { - List annotationProcessorPaths = annotationProcessorPathsWrapper.get().getChildren(); - String childName = annotationProcessorPaths.size() > 0 ? annotationProcessorPaths.get(0).getName() - : "path"; - - mavenCompilerPluginTag = FilterTagChildrenVisitor.filterTagChildren(mavenCompilerPluginTag, annotationProcessorPathsWrapper.get(), - child -> - !(child.getName().equals(childName) - && groupId.equals(child.getChildValue("groupId").orElse(null)) - && artifactId.equals(child.getChildValue("artifactId").orElse(null)))); + mavenCompilerPluginTag = FilterTagChildrenVisitor.filterTagChildren(mavenCompilerPluginTag, + annotationProcessorPathsWrapper.get(), + child -> !(groupId.equals(child.getChildValue("groupId").orElse(null)) + && artifactId.equals(child.getChildValue("artifactId").orElse(null)))); } - if(processorClass != null) { - Optional annotationProcessorsWrapper = configuration.get() - .getChild("annotationProcessors"); - if (annotationProcessorsWrapper.isPresent()) { - List annotationProcessors = annotationProcessorsWrapper.get().getChildren(); - String childName = annotationProcessors.size() > 0 ? annotationProcessors.get(0).getName() - : "annotationProcessor"; - - mavenCompilerPluginTag = FilterTagChildrenVisitor.filterTagChildren(mavenCompilerPluginTag, annotationProcessorsWrapper.get(), - child -> - !(child.getName().equals(childName) - && processorClass.equals(child.getValue().orElse(null)))); - } + if (processorClass != null) { + Optional annotationProcessorsWrapper = configuration.get() + .getChild("annotationProcessors"); + if (annotationProcessorsWrapper.isPresent()) { + mavenCompilerPluginTag = FilterTagChildrenVisitor.filterTagChildren(mavenCompilerPluginTag, + annotationProcessorsWrapper.get(), + child -> !processorClass.equals(child.getValue().orElse(null))); + } } } } diff --git a/recipes/src/main/resources/quarkus-updates/core/3.10.yaml b/recipes/src/main/resources/quarkus-updates/core/3.10.yaml new file mode 100644 index 0000000000..4653297405 --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/core/3.10.yaml @@ -0,0 +1,10 @@ +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus310.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen diff --git a/recipes/src/main/resources/quarkus-updates/core/3.11.yaml b/recipes/src/main/resources/quarkus-updates/core/3.11.yaml new file mode 100644 index 0000000000..c31307cfcf --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/core/3.11.yaml @@ -0,0 +1,10 @@ +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus311.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen diff --git a/recipes/src/main/resources/quarkus-updates/core/3.12.yaml b/recipes/src/main/resources/quarkus-updates/core/3.12.yaml new file mode 100644 index 0000000000..5cdf624e02 --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/core/3.12.yaml @@ -0,0 +1,10 @@ +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus312.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen diff --git a/recipes/src/main/resources/quarkus-updates/core/3.13.yaml b/recipes/src/main/resources/quarkus-updates/core/3.13.yaml new file mode 100644 index 0000000000..fd02e5257b --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/core/3.13.yaml @@ -0,0 +1,10 @@ +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus313.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen diff --git a/recipes/src/main/resources/quarkus-updates/core/3.7.alpha1.yaml b/recipes/src/main/resources/quarkus-updates/core/3.7.alpha1.yaml index 8303a5c5fd..0d7324eb62 100644 --- a/recipes/src/main/resources/quarkus-updates/core/3.7.alpha1.yaml +++ b/recipes/src/main/resources/quarkus-updates/core/3.7.alpha1.yaml @@ -81,6 +81,7 @@ recipeList: oldArtifactId: hibernate-jpamodelgen newGroupId: org.hibernate.orm newVersion: 6.x + enforceManagedVersion: true --- type: specs.openrewrite.org/v1beta/recipe name: io.quarkus.updates.core.quarkus37.AddJpaModelgenAnnotationProcessor @@ -88,6 +89,7 @@ recipeList: - io.quarkus.updates.core.quarkus37.AddMavenCompilerAnnotationProcessor: groupId: org.hibernate.orm artifactId: hibernate-jpamodelgen + enforceManagedVersion: true preconditions: - org.openrewrite.maven.search.FindDependency: groupId: org.hibernate.orm @@ -99,6 +101,7 @@ recipeList: - io.quarkus.updates.core.quarkus37.AddMavenCompilerAnnotationProcessor: groupId: org.hibernate.orm artifactId: hibernate-jpamodelgen + enforceManagedVersion: true preconditions: - org.openrewrite.maven.search.FindDependency: groupId: org.hibernate @@ -113,6 +116,16 @@ recipeList: - org.openrewrite.maven.RemoveDependency: groupId: org.hibernate.orm artifactId: hibernate-jpamodelgen +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus37.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen ##### # Upgrade to Java 17 diff --git a/recipes/src/main/resources/quarkus-updates/core/3.8.yaml b/recipes/src/main/resources/quarkus-updates/core/3.8.yaml new file mode 100644 index 0000000000..872a729cee --- /dev/null +++ b/recipes/src/main/resources/quarkus-updates/core/3.8.yaml @@ -0,0 +1,10 @@ +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus38.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen diff --git a/recipes/src/main/resources/quarkus-updates/core/3.9.yaml b/recipes/src/main/resources/quarkus-updates/core/3.9.yaml index ef07e2cb8d..9101f275b5 100644 --- a/recipes/src/main/resources/quarkus-updates/core/3.9.yaml +++ b/recipes/src/main/resources/quarkus-updates/core/3.9.yaml @@ -9,3 +9,14 @@ recipeList: groupId: io.quarkus artifactId: quarkus-panache-common processorClass: io.quarkus.panache.common.runtime.PanacheAnnotationProcessor + +##### +# Sync JPA model gen version with the one from the BOM +##### +--- +type: specs.openrewrite.org/v1beta/recipe +name: io.quarkus.updates.core.quarkus38.SyncHibernateJpaModelgenVersionWithBOM +recipeList: + - io.quarkus.updates.core.quarkus37.SyncMavenCompilerAnnotationProcessorVersion: + groupId: org.hibernate.orm + artifactId: hibernate-jpamodelgen