Reference
Design Partners
Migrate from Micronaut 2.x to 3.x
** org.openrewrite.java.micronaut.Micronaut2to3Migration** This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.

Source

  • groupId: org.openrewrite.recipe
  • artifactId: rewrite-micronaut
  • version: 1.12.0

Usage

This recipe has no required configuration options and can be activated directly after taking a dependency on org.openrewrite.recipe:rewrite-micronaut:1.12.0 in your build file:
Gradle
Maven
build.gradle
1
plugins {
2
id("org.openrewrite.rewrite") version("5.22.2")
3
}
4
5
rewrite {
6
activeRecipe("org.openrewrite.java.micronaut.Micronaut2to3Migration")
7
}
8
9
repositories {
10
mavenCentral()
11
}
12
13
dependencies {
14
rewrite("org.openrewrite.recipe:rewrite-micronaut:1.12.0")
15
}
Copied!
pom.xml
1
<project>
2
<build>
3
<plugins>
4
<plugin>
5
<groupId>org.openrewrite.maven</groupId>
6
<artifactId>rewrite-maven-plugin</artifactId>
7
<version>4.25.0</version>
8
<configuration>
9
<activeRecipes>
10
<recipe>org.openrewrite.java.micronaut.Micronaut2to3Migration</recipe>
11
</activeRecipes>
12
</configuration>
13
<dependencies>
14
<dependency>
15
<groupId>org.openrewrite.recipe</groupId>
16
<artifactId>rewrite-micronaut</artifactId>
17
<version>1.12.0</version>
18
</dependency>
19
</dependencies>
20
</plugin>
21
</plugins>
22
</build>
23
</project>
Copied!
Recipes can also be activated directly from the command line by adding the argument -Drewrite.activeRecipesorg.openrewrite.java.micronaut.Micronaut2to3Migration

Definition

Recipe List
Yaml Recipe List
    • groupId: io.micronaut
    • artifactId: micronaut-parent
    • newVersion: 3.x
    • groupId: io.micronaut
    • artifactId: micronaut-bom
    • newVersion: 3.x
    • overrideManagedVersion: true
    • oldPackageName: io.micronaut.configuration.cassandra
    • newPackageName: io.micronaut.cassandra
    • oldPackageName: io.micronaut.configuration.security.ldap
    • newPackageName: io.micronaut.security.ldap
    • methodPattern: io.micronaut.context.ApplicationContext build(..)
    • newMethodName: builder
    • oldFullyQualifiedTypeName: io.micronaut.core.async.SupplierUtil
    • newFullyQualifiedTypeName: io.micronaut.core.util.SupplierUtil
    • methodPattern: io.micronaut.http.netty.stream.DelegateHttpRequest getMethod()
    • newMethodName: method
    • methodPattern: io.micronaut.http.netty.stream.DelegateHttpResponse getStatus()
    • newMethodName: status
    • methodPattern: io.micronaut.http.server.netty.DelegateHttpResponse getStatus()
    • newMethodName: status
    • methodPattern: io.micronaut.http.netty.stream.DelegateHttpRequest getUri()
    • newMethodName: uri
    • methodPattern: io.micronaut.http.netty.stream.DelegateHttpMessage getDecoderResult()
    • newMethodName: decoderResult
    • methodPattern: io.micronaut.http.netty.stream.DelegateHttpMessage getProtocolVersion()
    • newMethodName: protocolVersion
    • oldFullyQualifiedTypeName: io.micronaut.management.endpoint.beans.impl.RxJavaBeanDefinitionDataCollector
    • newFullyQualifiedTypeName: io.micronaut.management.endpoint.beans.impl.DefaultBeanDefinitionDataCollector
    • oldFullyQualifiedTypeName: io.micronaut.management.endpoint.routes.impl.RxJavaRouteDataCollector
    • newFullyQualifiedTypeName: io.micronaut.management.endpoint.routes.impl.DefaultRouteDataCollector
    • oldFullyQualifiedTypeName: io.micronaut.management.health.aggregator.RxJavaHealthAggregator
    • newFullyQualifiedTypeName: io.micronaut.management.health.aggregator.DefaultHealthAggregator
    • oldFullyQualifiedTypeName: io.micronaut.messaging.annotation.Body
    • newFullyQualifiedTypeName: io.micronaut.messaging.annotation.MessageBody
    • oldFullyQualifiedTypeName: io.micronaut.messaging.annotation.Headers
    • newFullyQualifiedTypeName: io.micronaut.messaging.annotation.MessageHeaders
    • methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast isExplict()
    • newMethodName: isExplicit
    • methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast setExplict(boolean)
    • newMethodName: setExplicit
    • methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast explict(boolean)
    • newMethodName: setExplicit
    • methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcastEpisode isExplict()
    • newMethodName: isExplicit
    • oldFullyQualifiedTypeName: io.micronaut.runtime.server.EmbeddedServerInstance
    • newFullyQualifiedTypeName: io.micronaut.discovery.EmbeddedServerInstance
    • oldFullyQualifiedTypeName: io.micronaut.http.client.RxHttpClient
    • newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.RxHttpClient
    • oldFullyQualifiedTypeName: io.micronaut.http.client.RxProxyHttpClient
    • newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.proxy.RxProxyHttpClient
    • oldFullyQualifiedTypeName: io.micronaut.http.client.RxStreamingHttpClient
    • newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.RxStreamingHttpClient
    • oldFullyQualifiedTypeName: io.micronaut.http.client.sse.RxSseClient
    • newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.sse.RxSseClient
    • oldFullyQualifiedTypeName: io.micronaut.websocket.RxWebSocketClient
    • newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.websockets.RxWebSocketClient
    • methodPattern: io.micronaut.web.router accept(io.micronaut.http.MediaType)
    • newMethodName: doesConsume
    • methodPattern: io.micronaut.web.router.Route acceptAll()
    • newMethodName: consumesAll
    • methodPattern: io.micronaut.web.router.RouteMatch accept(io.micronaut.http.MediaType)
    • newMethodName: doesConsume
    • methodPattern: io.micronaut.web.router.RouteMatch explicitAccept(io.micronaut.http.MediaType)
    • newMethodName: explicitlyConsumes
    • oldFullyQualifiedTypeName: javax.annotation.Nullable
    • newFullyQualifiedTypeName: io.micronaut.core.annotation.Nullable
    • oldFullyQualifiedTypeName: javax.annotation.Nonnull
    • newFullyQualifiedTypeName: io.micronaut.core.annotation.NonNull
    • oldFullyQualifiedTypeName: io.micronaut.test.annotation.MicronautTest
    • newFullyQualifiedTypeName: io.micronaut.test.extensions.junit5.annotation.MicronautTest
1
---
2
type: specs.openrewrite.org/v1beta/recipe
3
name: org.openrewrite.java.micronaut.Micronaut2to3Migration
4
displayName: Migrate from Micronaut 2.x to 3.x
5
description: This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.
6
recipeList:
7
- org.openrewrite.java.micronaut.BeanPropertyCapitalizationStrategy
8
- org.openrewrite.java.micronaut.CopyNonInheritedAnnotations
9
- org.openrewrite.java.micronaut.SubclassesReturnedFromFactoriesNotInjectable
10
- org.openrewrite.java.micronaut.OncePerRequestHttpServerFilterToHttpServerFilter
11
- org.openrewrite.java.micronaut.ProviderImplementationsToMicronautFactories
12
- org.openrewrite.java.micronaut.TypeRequiresIntrospection
13
- org.openrewrite.java.micronaut.FixDeprecatedExceptionHandlerConstructors
14
- org.openrewrite.maven.UpgradeParentVersion:
15
groupId: io.micronaut
16
artifactId: micronaut-parent
17
newVersion: 3.x
18
- org.openrewrite.maven.UpgradeDependencyVersion:
19
groupId: io.micronaut
20
artifactId: micronaut-bom
21
newVersion: 3.x
22
overrideManagedVersion: true
23
- org.openrewrite.java.micronaut.UpgradeMicronautGradlePropertiesVersion:
24
newVersion: 3.x
25
- org.openrewrite.java.micronaut.UpgradeMicronautMavenPropertyVersion:
26
newVersion: 3.x
27
- org.openrewrite.java.ChangePackage:
28
oldPackageName: io.micronaut.configuration.cassandra
29
newPackageName: io.micronaut.cassandra
30
- org.openrewrite.java.ChangePackage:
31
oldPackageName: io.micronaut.configuration.security.ldap
32
newPackageName: io.micronaut.security.ldap
33
- org.openrewrite.java.ChangeMethodName:
34
methodPattern: io.micronaut.context.ApplicationContext build(..)
35
newMethodName: builder
36
- org.openrewrite.java.ChangeType:
37
oldFullyQualifiedTypeName: io.micronaut.core.async.SupplierUtil
38
newFullyQualifiedTypeName: io.micronaut.core.util.SupplierUtil
39
- org.openrewrite.java.ChangeMethodName:
40
methodPattern: io.micronaut.http.netty.stream.DelegateHttpRequest getMethod()
41
newMethodName: method
42
- org.openrewrite.java.ChangeMethodName:
43
methodPattern: io.micronaut.http.netty.stream.DelegateHttpResponse getStatus()
44
newMethodName: status
45
- org.openrewrite.java.ChangeMethodName:
46
methodPattern: io.micronaut.http.server.netty.DelegateHttpResponse getStatus()
47
newMethodName: status
48
- org.openrewrite.java.ChangeMethodName:
49
methodPattern: io.micronaut.http.netty.stream.DelegateHttpRequest getUri()
50
newMethodName: uri
51
- org.openrewrite.java.ChangeMethodName:
52
methodPattern: io.micronaut.http.netty.stream.DelegateHttpMessage getDecoderResult()
53
newMethodName: decoderResult
54
- org.openrewrite.java.ChangeMethodName:
55
methodPattern: io.micronaut.http.netty.stream.DelegateHttpMessage getProtocolVersion()
56
newMethodName: protocolVersion
57
- org.openrewrite.java.ChangeType:
58
oldFullyQualifiedTypeName: io.micronaut.management.endpoint.beans.impl.RxJavaBeanDefinitionDataCollector
59
newFullyQualifiedTypeName: io.micronaut.management.endpoint.beans.impl.DefaultBeanDefinitionDataCollector
60
- org.openrewrite.java.ChangeType:
61
oldFullyQualifiedTypeName: io.micronaut.management.endpoint.routes.impl.RxJavaRouteDataCollector
62
newFullyQualifiedTypeName: io.micronaut.management.endpoint.routes.impl.DefaultRouteDataCollector
63
- org.openrewrite.java.ChangeType:
64
oldFullyQualifiedTypeName: io.micronaut.management.health.aggregator.RxJavaHealthAggregator
65
newFullyQualifiedTypeName: io.micronaut.management.health.aggregator.DefaultHealthAggregator
66
- org.openrewrite.java.ChangeType:
67
oldFullyQualifiedTypeName: io.micronaut.messaging.annotation.Body
68
newFullyQualifiedTypeName: io.micronaut.messaging.annotation.MessageBody
69
- org.openrewrite.java.ChangeType:
70
oldFullyQualifiedTypeName: io.micronaut.messaging.annotation.Headers
71
newFullyQualifiedTypeName: io.micronaut.messaging.annotation.MessageHeaders
72
- org.openrewrite.java.ChangeMethodName:
73
methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast isExplict()
74
newMethodName: isExplicit
75
- org.openrewrite.java.ChangeMethodName:
76
methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast setExplict(boolean)
77
newMethodName: setExplicit
78
- org.openrewrite.java.ChangeMethodName:
79
methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcast explict(boolean)
80
newMethodName: setExplicit
81
- org.openrewrite.java.ChangeMethodName:
82
methodPattern: io.micronaut.rss.itunespodcast.ItunesPodcastEpisode isExplict()
83
newMethodName: isExplicit
84
- org.openrewrite.java.ChangeType:
85
oldFullyQualifiedTypeName: io.micronaut.runtime.server.EmbeddedServerInstance
86
newFullyQualifiedTypeName: io.micronaut.discovery.EmbeddedServerInstance
87
- org.openrewrite.java.ChangeType:
88
oldFullyQualifiedTypeName: io.micronaut.http.client.RxHttpClient
89
newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.RxHttpClient
90
- org.openrewrite.java.ChangeType:
91
oldFullyQualifiedTypeName: io.micronaut.http.client.RxProxyHttpClient
92
newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.proxy.RxProxyHttpClient
93
- org.openrewrite.java.ChangeType:
94
oldFullyQualifiedTypeName: io.micronaut.http.client.RxStreamingHttpClient
95
newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.RxStreamingHttpClient
96
- org.openrewrite.java.ChangeType:
97
oldFullyQualifiedTypeName: io.micronaut.http.client.sse.RxSseClient
98
newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.sse.RxSseClient
99
- org.openrewrite.java.ChangeType:
100
oldFullyQualifiedTypeName: io.micronaut.websocket.RxWebSocketClient
101
newFullyQualifiedTypeName: io.micronaut.rxjava2.http.client.websockets.RxWebSocketClient
102
- org.openrewrite.java.ChangeMethodName:
103
methodPattern: io.micronaut.web.router accept(io.micronaut.http.MediaType)
104
newMethodName: doesConsume
105
- org.openrewrite.java.ChangeMethodName:
106
methodPattern: io.micronaut.web.router.Route acceptAll()
107
newMethodName: consumesAll
108
- org.openrewrite.java.ChangeMethodName:
109
methodPattern: io.micronaut.web.router.RouteMatch accept(io.micronaut.http.MediaType)
110
newMethodName: doesConsume
111
- org.openrewrite.java.ChangeMethodName:
112
methodPattern: io.micronaut.web.router.RouteMatch explicitAccept(io.micronaut.http.MediaType)
113
newMethodName: explicitlyConsumes
114
- org.openrewrite.java.ChangeType:
115
oldFullyQualifiedTypeName: javax.annotation.Nullable
116
newFullyQualifiedTypeName: io.micronaut.core.annotation.Nullable
117
- org.openrewrite.java.ChangeType:
118
oldFullyQualifiedTypeName: javax.annotation.Nonnull
119
newFullyQualifiedTypeName: io.micronaut.core.annotation.NonNull
120
- org.openrewrite.java.ChangeType:
121
oldFullyQualifiedTypeName: io.micronaut.test.annotation.MicronautTest
122
newFullyQualifiedTypeName: io.micronaut.test.extensions.junit5.annotation.MicronautTest
Copied!
Export as PDF
Copy link