Package org.axonframework.migration
Class UpgradeKotlin
java.lang.Object
org.openrewrite.Recipe
org.axonframework.migration.UpgradeKotlin
- All Implemented Interfaces:
Cloneable
public class UpgradeKotlin
extends org.openrewrite.Recipe
Bumps Kotlin to a configurable 2.x line, with validation that the target satisfies the Axon Framework 5
minimum (Kotlin 2.0).
Wraps two upstream recipes to cover the two places a Kotlin version is pinned in a typical Maven build:
UpgradeDependencyVersionfororg.jetbrains.kotlin:*— bumpskotlin-stdlib,kotlin-reflect,kotlin-stdlib-jdk8, and any other Kotlin runtime artifacts the project declares (Maven and Gradle); andUpgradePluginVersionfororg.jetbrains.kotlin:kotlin-maven-plugin— bumps the Kotlin compiler plugin so Maven builds compile against the new language line.
The default target is "2.x" (Node-Semver "latest 2.x"), chosen so projects
already on a higher Kotlin 2.x release are left untouched — UpgradeDependencyVersion only
upgrades, never downgrades.
The targetVersion option is overridable per invocation; values whose major version is below
2 are rejected so misconfigurations fail loudly rather than silently
pinning the build to a Kotlin 1.x line that Axon Framework 5 does not support.
- Since:
- 5.1.1
- Author:
- Mateusz Nowak
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault Node-Semver selector used whentargetVersionis unset.static final intMinimum supported major version.Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.openrewrite.Recipe
addDataTable, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getTags, getVisitor, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Field Details
-
DEFAULT_TARGET_VERSION
Default Node-Semver selector used whentargetVersionis unset."2.x"resolves to the latest published Kotlin 2.x release, so projects already on a higher 2.x line are left untouched (the underlying upgrade recipes never downgrade).- See Also:
-
MINIMUM_MAJOR_VERSION
public static final int MINIMUM_MAJOR_VERSIONMinimum supported major version. Axon Framework 5 requires Kotlin 2.x or higher; targets whose major component is below this are rejected at configuration time.- See Also:
-
-
Constructor Details
-
UpgradeKotlin
public UpgradeKotlin() -
UpgradeKotlin
-
-
Method Details
-
getTargetVersion
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getRecipeList
- Overrides:
getRecipeListin classorg.openrewrite.Recipe
-