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