Migrate from Micronaut 2.x to 3.x
Apache 2.0This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.
org. openrewrite. java. micronaut. Micronaut2to3Migrationmod run . --recipe= org. openrewrite. java. micronaut. Micronaut2to3MigrationInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Change type
javax.annotation.Nullabletoio.micronaut.core.annotation.Nullable - Change type
NonnulltoNonNull - Migrate to Jakarta EE 9
- De-capitalize
BeanIntrospectiongetProperty(..)andgetRequiredProperty(..)name arguments - Copy non-inherited annotations from super class
- Change factory method return types to reflect their resolved return type
- Convert
OncePerRequestServerFilterextensions toHttpServerFilter Providerimplementation beans to Micronaut@Factory- Add
@Introspectedto classes requiring a map representation - Fix deprecated no-arg
ExceptionHandlerconstructors - Upgrade Maven parent project version to
io.micronaut:micronaut-parent:3.x - Upgrade Maven dependency version
io.micronaut:micronaut-bom:3.x - Upgrade gradle.properties Micronaut version
3.x - Upgrade
micronaut.versionMaven property3.x - Rename package name
io.micronaut.configuration.cassandratoio.micronaut.cassandra - Rename package name
io.micronaut.configuration.security.ldaptoio.micronaut.security.ldap - Change method name
io.micronaut.context.ApplicationContext build(..)tobuilder - Change type
io.micronaut.core.async.SupplierUtiltoio.micronaut.core.util.SupplierUtil - Change method name
io.micronaut.http.netty.stream.DelegateHttpRequest getMethod()tomethod - Change method name
io.micronaut.http.netty.stream.DelegateHttpResponse getStatus()tostatus - Change method name
io.micronaut.http.server.netty.DelegateHttpResponse getStatus()tostatus - Change method name
io.micronaut.http.netty.stream.DelegateHttpRequest getUri()touri - Change method name
io.micronaut.http.netty.stream.DelegateHttpMessage getDecoderResult()todecoderResult - Change method name
io.micronaut.http.netty.stream.DelegateHttpMessage getProtocolVersion()toprotocolVersion - Change type
RxJavaBeanDefinitionDataCollectortoDefaultBeanDefinitionDataCollector - Change type
RxJavaRouteDataCollectortoDefaultRouteDataCollector - Change type
RxJavaHealthAggregatortoDefaultHealthAggregator - Change type
BodytoMessageBody - Change type
HeaderstoMessageHeaders - Change method name
io.micronaut.rss.itunespodcast.ItunesPodcast isExplict()toisExplicit - Change method name
io.micronaut.rss.itunespodcast.ItunesPodcast setExplict(boolean)tosetExplicit - Change method name
io.micronaut.rss.itunespodcast.ItunesPodcast explict(boolean)tosetExplicit - Change method name
io.micronaut.rss.itunespodcast.ItunesPodcastEpisode isExplict()toisExplicit - Change type
io.micronaut.runtime.server.EmbeddedServerInstancetoio.micronaut.discovery.EmbeddedServerInstance - Change type
io.micronaut.http.client.RxHttpClienttoio.micronaut.rxjava2.http.client.RxHttpClient - Change type
io.micronaut.http.client.RxProxyHttpClienttoio.micronaut.rxjava2.http.client.proxy.RxProxyHttpClient - Change type
io.micronaut.http.client.RxStreamingHttpClienttoio.micronaut.rxjava2.http.client.RxStreamingHttpClient - Change type
io.micronaut.http.client.sse.RxSseClienttoio.micronaut.rxjava2.http.client.sse.RxSseClient - Change type
io.micronaut.websocket.RxWebSocketClienttoio.micronaut.rxjava2.http.client.websockets.RxWebSocketClient - Change method name
io.micronaut.web.router accept(io.micronaut.http.MediaType)todoesConsume - Change method name
io.micronaut.web.router.Route acceptAll()toconsumesAll - Change method name
io.micronaut.web.router.RouteMatch accept(io.micronaut.http.MediaType)todoesConsume - Change method name
io.micronaut.web.router.RouteMatch explicitAccept(io.micronaut.http.MediaType)toexplicitlyConsumes - Change type
io.micronaut.test.annotation.MicronautTesttoio.micronaut.test.extensions.junit5.annotation.MicronautTest