From f1daeb9fe5acc93c3e4b4a3e91b1587df9bb1b32 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Wed, 4 Sep 2024 23:19:54 -0400 Subject: [PATCH] Javax to Jakarta transition + mongoDB driver --- build.gradle | 7 +------ gradle.properties | 12 ++++++------ gradle/docs.gradle | 2 -- grails-core/build.gradle | 6 +++--- .../grails/boot/config/tools/ClassPathScanner.groovy | 2 +- .../grails/compiler/injection/GrailsASTUtils.java | 2 +- .../AnnotationDomainClassArtefactHandler.java | 2 +- .../core/artefact/DomainClassArtefactHandler.java | 5 ++--- .../org/grails/plugins/core/CoreConfiguration.java | 5 ----- .../grails/config/PropertySourcesConfigSpec.groovy | 2 +- grails-docs/src/test/resources/docs/guide/async.html | 2 +- .../src/test/resources/docs/guide/hibernate.html | 6 +++--- .../test/resources/docs/guide/pages/consuming.html | 2 +- .../src/test/resources/docs/guide/pages/events.html | 2 +- .../guide/pages/mappingWithHibernateAnnotations.html | 6 +++--- .../src/test/resources/docs/guide/single.backup.html | 8 ++++---- .../src/test/resources/docs/guide/single.html | 8 ++++---- .../compiler/web/ControllerActionTransformer.java | 2 +- .../converters/Jsr310ConvertersConfiguration.groovy | 2 +- grails-plugin-domain-class/build.gradle | 2 +- grails-plugin-rest/build.gradle | 2 +- .../grails/rest/render/hal/HalJsonRenderer.groovy | 4 ++-- .../grails/rest/render/json/JsonRenderer.groovy | 2 +- .../groovy/grails/rest/render/xml/XmlRenderer.groovy | 2 +- .../web/rest/render/DefaultRendererRegistry.groovy | 2 +- .../web/rest/transform/ResourceTransform.groovy | 2 +- .../web/rest/render/hal/HalJsonRendererSpec.groovy | 2 +- .../SpringBootCompilerAutoConfiguration.java | 2 +- .../web/converters/MarshallerRegistrarSpec.groovy | 2 +- .../main/groovy/org/grails/web/util/WebUtils.java | 10 +++++----- .../DefaultDataBindingSourceRegistry.groovy | 2 +- grails-web-url-mappings/build.gradle | 2 +- .../grails/web/mapping/DefaultLinkGenerator.groovy | 2 +- 33 files changed, 54 insertions(+), 67 deletions(-) diff --git a/build.gradle b/build.gradle index 6efaffa313b..09dbdc2f393 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { classpath "io.github.gradle-nexus:publish-plugin:1.3.0" classpath "com.netflix.nebula:gradle-extra-configurations-plugin:10.0.0" classpath "com.bmuschko:gradle-nexus-plugin:$gradleNexusPluginVersion" - classpath "javax.xml.bind:jaxb-api:$jaxbApiVersion" + classpath "jakarta.xml.bind:jakarta.xml.bind-api:$jakartaXmlBindVersion" classpath "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion" classpath("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1") } @@ -33,11 +33,6 @@ ext { names : ['fields'], modules: [''] ], - 'javax.annotation-api' : [version: javaxAnnotationApiVersion, - group : 'javax.annotation', - names : ['javax.annotation'], - modules: ['api'] - ], 'jakarta-annotation' : [version: jakartaAnnotationApiVersion, group : 'jakarta.annotation', names : ['jakarta.annotation-api'], diff --git a/gradle.properties b/gradle.properties index e0aac1993f7..d725f2b7f17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,16 +13,16 @@ gradleNexusPluginVersion=2.3.1 gradleNexusStagingPluginVersion=0.12.0 groovyVersion=4.0.22 gspVersion=7.0.0-SNAPSHOT -h2.version=2.2.224 h2Version=2.2.224 jacksonVersion=2.17.2 hibernateDatastoreVersion=9.0.0-SNAPSHOT -jakartaAnnotationApiVersion=2.0.0 +jakartaAnnotationApiVersion=3.0.0 +jakartaXmlBindVersion=4.0.2 +jaxbImplVersion=4.0.5 +jakartaInjectVersion=2.0.1 +jakartaPersistenceVersion=3.1.0 jansiVersion=1.18 javaParserCoreVersion=3.25.10 -javaxAnnotationApiVersion=1.3.2 -jaxbApiVersion=2.3.1 -jaxbImplVersion=4.0.5 jlineVersion=2.14.6 jnaVersion=5.14.0 junitVersion=4.13.2 @@ -33,7 +33,7 @@ micronautCacheVersion=4.3.0 micronautRuntimeGroovyVersion=4.3.0 micronautSpringVersion=5.7.0 micronautVersion=4.5.3 -mongodbJavaDriverVersion=4.11.0 +mongodbJavaDriverVersion=5.1.4 objenesisVersion=3.3 scaffoldingCoreVersion=2.1.0 servletApiVersion=6.0.0 diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 0aa25e68593..dcafb4fe057 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -107,8 +107,6 @@ tasks.register('groovydoc', Groovydoc) { source subProjects.sourceSets.main.groovy.srcDirs // Can't make these link methods to work // link("http://static.springsource.org/spring/docs/3.0.x/javadoc-api", "org.springframework.") -// link("http://download.oracle.com/javase/1.5.0/docs/api", "java." , "javax.") -// link("http://download.oracle.com/javaee/5/api", "javax.") doLast { delete("${buildDir}/tmp") } diff --git a/grails-core/build.gradle b/grails-core/build.gradle index af42348a4cf..3677b535245 100644 --- a/grails-core/build.gradle +++ b/grails-core/build.gradle @@ -10,7 +10,7 @@ dependencies { annotationProcessor "io.micronaut.spring:micronaut-spring-annotation:$micronautSpringVersion" annotationProcessor "io.micronaut.cache:micronaut-cache-core:$micronautCacheVersion" api "io.micronaut:micronaut-inject:$micronautVersion" - api "javax.inject:javax.inject:1" + api "jakarta.inject:jakarta.inject-api:$jakartaInjectVersion" api "io.micronaut.spring:micronaut-spring-context:$micronautSpringVersion", { exclude group:"org.slf4j", module: "slf4j-simple" } @@ -18,8 +18,8 @@ dependencies { exclude group:"org.slf4j", module: "slf4j-simple" } api "io.micronaut:micronaut-runtime:$micronautVersion" - api 'javax.persistence:javax.persistence-api:2.2' - api "javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion" + api "jakarta.persistence:jakarta.persistence-api:$jakartaPersistenceVersion" + api "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion" implementation "com.github.ben-manes.caffeine:caffeine:$caffeineVersion" api("org.springframework.boot:spring-boot:$springBootVersion") diff --git a/grails-core/src/main/groovy/grails/boot/config/tools/ClassPathScanner.groovy b/grails-core/src/main/groovy/grails/boot/config/tools/ClassPathScanner.groovy index e2114dee777..a59a601053f 100644 --- a/grails-core/src/main/groovy/grails/boot/config/tools/ClassPathScanner.groovy +++ b/grails-core/src/main/groovy/grails/boot/config/tools/ClassPathScanner.groovy @@ -41,7 +41,7 @@ import java.lang.annotation.Annotation @Slf4j @CompileStatic class ClassPathScanner { - private static final List DEFAULT_IGNORED_ROOT_PACKAGES = ['com', 'org', 'net', 'co', 'java', 'javax', 'groovy'] + private static final List DEFAULT_IGNORED_ROOT_PACKAGES = ['com', 'org', 'net', 'co', 'java', 'javax', 'jakarta', 'groovy'] /** diff --git a/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java b/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java index 675f374918c..9cd23c1cce5 100644 --- a/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java +++ b/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java @@ -722,7 +722,7 @@ public static boolean isDomainClass(final ClassNode classNode, final SourceUnit @SuppressWarnings("unchecked") boolean isDomainClass = GrailsASTUtils.hasAnyAnnotations(classNode, grails.persistence.Entity.class, - javax.persistence.Entity.class); + jakarta.persistence.Entity.class); if (!isDomainClass && sourceNode != null) { final String sourcePath = sourceNode.getName(); diff --git a/grails-core/src/main/groovy/org/grails/core/artefact/AnnotationDomainClassArtefactHandler.java b/grails-core/src/main/groovy/org/grails/core/artefact/AnnotationDomainClassArtefactHandler.java index fcf2e0f0c4b..3c7c401f51f 100644 --- a/grails-core/src/main/groovy/org/grails/core/artefact/AnnotationDomainClassArtefactHandler.java +++ b/grails-core/src/main/groovy/org/grails/core/artefact/AnnotationDomainClassArtefactHandler.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -import javax.persistence.Entity; +import jakarta.persistence.Entity; /** * Detects annotated domain classes for EJB3 style mappings. diff --git a/grails-core/src/main/groovy/org/grails/core/artefact/DomainClassArtefactHandler.java b/grails-core/src/main/groovy/org/grails/core/artefact/DomainClassArtefactHandler.java index d8d836fd953..9925d921050 100644 --- a/grails-core/src/main/groovy/org/grails/core/artefact/DomainClassArtefactHandler.java +++ b/grails-core/src/main/groovy/org/grails/core/artefact/DomainClassArtefactHandler.java @@ -21,7 +21,6 @@ import grails.core.GrailsClass; import grails.core.GrailsDomainClass; import grails.core.support.GrailsApplicationAware; -import grails.util.Environment; import groovy.lang.Closure; import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.ast.InnerClassNode; @@ -48,7 +47,7 @@ public class DomainClassArtefactHandler extends ArtefactHandlerAdapter implement public static final String PLUGIN_NAME = "domainClass"; private static final String ENTITY_ANN_NAME = "Entity"; private static final String GRAILS_PACKAGE_PREFIX = "grails."; - private static final String JAVAX_PERSISTENCE = "javax.persistence"; + private static final String JAKARTA_PERSISTENCE = "jakarta.persistence"; public DomainClassArtefactHandler() { super(TYPE, GrailsDomainClass.class, DefaultGrailsDomainClass.class, null, true); @@ -149,7 +148,7 @@ private static boolean doIsDomainClassCheck(Class clazz) { String annName = annType.getSimpleName(); String pkgName = annType.getPackage().getName(); - if(ENTITY_ANN_NAME.equals(annName) && pkgName.startsWith(GRAILS_PACKAGE_PREFIX) || pkgName.startsWith(JAVAX_PERSISTENCE)) { + if(ENTITY_ANN_NAME.equals(annName) && pkgName.startsWith(GRAILS_PACKAGE_PREFIX) || pkgName.startsWith(JAKARTA_PERSISTENCE)) { return true; } } diff --git a/grails-core/src/main/groovy/org/grails/plugins/core/CoreConfiguration.java b/grails-core/src/main/groovy/org/grails/plugins/core/CoreConfiguration.java index 5f042870540..21e76c9571c 100644 --- a/grails-core/src/main/groovy/org/grails/plugins/core/CoreConfiguration.java +++ b/grails-core/src/main/groovy/org/grails/plugins/core/CoreConfiguration.java @@ -21,14 +21,9 @@ import io.micronaut.context.annotation.Factory; import io.micronaut.context.event.ApplicationEventListener; import io.micronaut.context.event.ShutdownEvent; -import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Component; - -import javax.inject.Named; -import javax.inject.Singleton; /** * Core beans. diff --git a/grails-core/src/test/groovy/org/grails/config/PropertySourcesConfigSpec.groovy b/grails-core/src/test/groovy/org/grails/config/PropertySourcesConfigSpec.groovy index 058c279bb36..4e32cae754f 100644 --- a/grails-core/src/test/groovy/org/grails/config/PropertySourcesConfigSpec.groovy +++ b/grails-core/src/test/groovy/org/grails/config/PropertySourcesConfigSpec.groovy @@ -7,7 +7,7 @@ import spock.lang.Ignore import spock.lang.Issue import spock.lang.Specification -import javax.persistence.FlushModeType +import jakarta.persistence.FlushModeType /* * Copyright 2014 original authors diff --git a/grails-docs/src/test/resources/docs/guide/async.html b/grails-docs/src/test/resources/docs/guide/async.html index 2c78af06ebb..43bd10f8a98 100644 --- a/grails-docs/src/test/resources/docs/guide/async.html +++ b/grails-docs/src/test/resources/docs/guide/async.html @@ -755,7 +755,7 @@

11.3.1 Consuming Events

import grails.events.*
-import javax.annotation.*
+import jakarta.annotation.*
 
 class MyClass implements Events {
 
diff --git a/grails-docs/src/test/resources/docs/guide/hibernate.html b/grails-docs/src/test/resources/docs/guide/hibernate.html
index 311533468f4..2d133fabff2 100644
--- a/grails-docs/src/test/resources/docs/guide/hibernate.html
+++ b/grails-docs/src/test/resources/docs/guide/hibernate.html
@@ -236,9 +236,9 @@ 

20.2 Mapping with Hibernate Annotations
package com.books;
 
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
 
 @Entity
 public class Book {
diff --git a/grails-docs/src/test/resources/docs/guide/pages/consuming.html b/grails-docs/src/test/resources/docs/guide/pages/consuming.html
index f05ef2bed47..ec65b3688bd 100644
--- a/grails-docs/src/test/resources/docs/guide/pages/consuming.html
+++ b/grails-docs/src/test/resources/docs/guide/pages/consuming.html
@@ -167,7 +167,7 @@ 

11.3.1 Consuming Events

import grails.events.*
-import javax.annotation.*
+import jakarta.annotation.*
 
 class MyClass implements Events {
 
diff --git a/grails-docs/src/test/resources/docs/guide/pages/events.html b/grails-docs/src/test/resources/docs/guide/pages/events.html
index 48811c227fe..b7325a38dae 100644
--- a/grails-docs/src/test/resources/docs/guide/pages/events.html
+++ b/grails-docs/src/test/resources/docs/guide/pages/events.html
@@ -221,7 +221,7 @@ 

11.3.1 Consuming Events

import grails.events.*
-import javax.annotation.*
+import jakarta.annotation.*
 
 class MyClass implements Events {
 
diff --git a/grails-docs/src/test/resources/docs/guide/pages/mappingWithHibernateAnnotations.html b/grails-docs/src/test/resources/docs/guide/pages/mappingWithHibernateAnnotations.html
index faa3f2b6c84..d211d7bfd41 100644
--- a/grails-docs/src/test/resources/docs/guide/pages/mappingWithHibernateAnnotations.html
+++ b/grails-docs/src/test/resources/docs/guide/pages/mappingWithHibernateAnnotations.html
@@ -152,9 +152,9 @@ 

20.2 Mapping with Hibernate Annotations
package com.books;
 
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
 
 @Entity
 public class Book {
diff --git a/grails-docs/src/test/resources/docs/guide/single.backup.html b/grails-docs/src/test/resources/docs/guide/single.backup.html
index 01403854597..f14e6c43f10 100644
--- a/grails-docs/src/test/resources/docs/guide/single.backup.html
+++ b/grails-docs/src/test/resources/docs/guide/single.backup.html
@@ -16642,7 +16642,7 @@ 

11.3.1 Consuming Events

import grails.events.*
-import javax.annotation.*
+import jakarta.annotation.*
 
 class MyClass implements Events {
 
@@ -24959,9 +24959,9 @@ 

20.2 Mapping with Hibernate Annotations
package com.books;
 
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
 
 @Entity
 public class Book {
diff --git a/grails-docs/src/test/resources/docs/guide/single.html b/grails-docs/src/test/resources/docs/guide/single.html
index 01403854597..f14e6c43f10 100644
--- a/grails-docs/src/test/resources/docs/guide/single.html
+++ b/grails-docs/src/test/resources/docs/guide/single.html
@@ -16642,7 +16642,7 @@ 

11.3.1 Consuming Events

import grails.events.*
-import javax.annotation.*
+import jakarta.annotation.*
 
 class MyClass implements Events {
 
@@ -24959,9 +24959,9 @@ 

20.2 Mapping with Hibernate Annotations
package com.books;
 
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
 
 @Entity
 public class Book {
diff --git a/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java b/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
index d6d8eb12b9e..959a53ecd0a 100644
--- a/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
+++ b/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
@@ -770,7 +770,7 @@ protected void initializeAndValidateCommandObjectParameter(final BlockStatement
             boolean argumentIsValidateable = GrailsASTUtils.hasAnyAnnotations(
                     commandObjectNode,
                     grails.persistence.Entity.class,
-                    javax.persistence.Entity.class) ||
+                    jakarta.persistence.Entity.class) ||
                     commandObjectNode.implementsInterface(ClassHelper.make(Validateable.class));
 
             if (!argumentIsValidateable && commandObjectNode.isPrimaryClassNode()) {
diff --git a/grails-plugin-databinding/src/main/groovy/org/grails/databinding/converters/Jsr310ConvertersConfiguration.groovy b/grails-plugin-databinding/src/main/groovy/org/grails/databinding/converters/Jsr310ConvertersConfiguration.groovy
index fb3cd6ad0b1..4eef90c24e0 100644
--- a/grails-plugin-databinding/src/main/groovy/org/grails/databinding/converters/Jsr310ConvertersConfiguration.groovy
+++ b/grails-plugin-databinding/src/main/groovy/org/grails/databinding/converters/Jsr310ConvertersConfiguration.groovy
@@ -7,7 +7,7 @@ import org.grails.plugins.databinding.DataBindingConfigurationProperties
 import org.springframework.context.annotation.Bean
 import org.springframework.context.annotation.Configuration
 
-import javax.inject.Inject
+import jakarta.inject.Inject
 import java.time.*
 import java.time.format.DateTimeFormatter
 
diff --git a/grails-plugin-domain-class/build.gradle b/grails-plugin-domain-class/build.gradle
index d4b0830adee..18dac8a384f 100644
--- a/grails-plugin-domain-class/build.gradle
+++ b/grails-plugin-domain-class/build.gradle
@@ -51,7 +51,7 @@ dependencies {
         exclude group: 'commons-lang', module:'commons-lang'
         exclude group: 'javassist', module:'javassist'
         exclude group: 'org.javassist', module: 'javassist'
-        exclude group: "javax.persistence", module:"persistence-api"
+        exclude group: "jakarta.persistence", module:"persistence-api"
         exclude group: 'java-persistence', module:'persistence-api'
     }
 
diff --git a/grails-plugin-rest/build.gradle b/grails-plugin-rest/build.gradle
index 8b996421fa9..8bc15a3934f 100644
--- a/grails-plugin-rest/build.gradle
+++ b/grails-plugin-rest/build.gradle
@@ -1,6 +1,6 @@
 dependencies {
 
-    api 'javax.xml.bind:jaxb-api:2.3.1'
+    api "jakarta.xml.bind:jakarta.xml.bind-api:$jakartaXmlBindVersion"
 
     api project(":grails-web"),
             project(":grails-plugin-controllers"),
diff --git a/grails-plugin-rest/src/main/groovy/grails/rest/render/hal/HalJsonRenderer.groovy b/grails-plugin-rest/src/main/groovy/grails/rest/render/hal/HalJsonRenderer.groovy
index 07885d5f50d..2ba04b47dbd 100644
--- a/grails-plugin-rest/src/main/groovy/grails/rest/render/hal/HalJsonRenderer.groovy
+++ b/grails-plugin-rest/src/main/groovy/grails/rest/render/hal/HalJsonRenderer.groovy
@@ -33,8 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.core.convert.converter.Converter
 import org.springframework.http.HttpMethod
 
-import javax.annotation.PostConstruct
-import javax.xml.bind.DatatypeConverter
+import jakarta.annotation.PostConstruct
+import jakarta.xml.bind.DatatypeConverter
 /**
  * Renders domain instances in HAL JSON format (see http://tools.ietf.org/html/draft-kelly-json-hal-05)
  *
diff --git a/grails-plugin-rest/src/main/groovy/grails/rest/render/json/JsonRenderer.groovy b/grails-plugin-rest/src/main/groovy/grails/rest/render/json/JsonRenderer.groovy
index be9621e24ff..45112c20463 100644
--- a/grails-plugin-rest/src/main/groovy/grails/rest/render/json/JsonRenderer.groovy
+++ b/grails-plugin-rest/src/main/groovy/grails/rest/render/json/JsonRenderer.groovy
@@ -31,7 +31,7 @@ import grails.web.mime.MimeType
 import org.grails.plugins.web.rest.render.json.DefaultJsonRenderer
 import org.springframework.beans.factory.annotation.Autowired
 
-import javax.annotation.PostConstruct
+import jakarta.annotation.PostConstruct
 
 /**
  *
diff --git a/grails-plugin-rest/src/main/groovy/grails/rest/render/xml/XmlRenderer.groovy b/grails-plugin-rest/src/main/groovy/grails/rest/render/xml/XmlRenderer.groovy
index 020ee486ee4..ccdd4c287d4 100644
--- a/grails-plugin-rest/src/main/groovy/grails/rest/render/xml/XmlRenderer.groovy
+++ b/grails-plugin-rest/src/main/groovy/grails/rest/render/xml/XmlRenderer.groovy
@@ -30,7 +30,7 @@ import grails.web.mime.MimeType
 import org.grails.plugins.web.rest.render.xml.DefaultXmlRenderer
 import org.springframework.beans.factory.annotation.Autowired
 
-import javax.annotation.PostConstruct
+import jakarta.annotation.PostConstruct
 
 /**
  * An XML renderer that allows including / excluding properties
diff --git a/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/DefaultRendererRegistry.groovy b/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/DefaultRendererRegistry.groovy
index 5f9b234003a..36dba62d4b2 100644
--- a/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/DefaultRendererRegistry.groovy
+++ b/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/render/DefaultRendererRegistry.groovy
@@ -25,7 +25,7 @@ import groovy.transform.CompileStatic
 
 import java.util.concurrent.ConcurrentHashMap
 
-import javax.annotation.PostConstruct
+import jakarta.annotation.PostConstruct
 
 import grails.util.GrailsClassUtils
 import grails.core.support.proxy.ProxyHandler
diff --git a/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/transform/ResourceTransform.groovy b/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/transform/ResourceTransform.groovy
index 310e610d7fb..23be4085200 100644
--- a/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/transform/ResourceTransform.groovy
+++ b/grails-plugin-rest/src/main/groovy/org/grails/plugins/web/rest/transform/ResourceTransform.groovy
@@ -34,7 +34,7 @@ import groovy.transform.CompileStatic
 
 import java.lang.reflect.Modifier
 
-import javax.annotation.PostConstruct
+import jakarta.annotation.PostConstruct
 
 import org.codehaus.groovy.ast.ASTNode
 import org.codehaus.groovy.ast.AnnotationNode
diff --git a/grails-plugin-rest/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy b/grails-plugin-rest/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
index 59532905666..e8957131c24 100644
--- a/grails-plugin-rest/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
+++ b/grails-plugin-rest/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
@@ -62,7 +62,7 @@ import spock.lang.Issue
 import spock.lang.Shared
 import spock.lang.Specification
 
-import javax.xml.bind.DatatypeConverter
+import jakarta.xml.bind.DatatypeConverter
 
 /**
  */
diff --git a/grails-shell/src/main/groovy/org/grails/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java b/grails-shell/src/main/groovy/org/grails/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java
index a586078faed..b2e4a1ac4d0 100644
--- a/grails-shell/src/main/groovy/org/grails/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java
+++ b/grails-shell/src/main/groovy/org/grails/cli/compiler/autoconfigure/SpringBootCompilerAutoConfiguration.java
@@ -45,7 +45,7 @@ public void applyDependencies(DependencyCustomizer dependencies) {
 
 	@Override
 	public void applyImports(ImportCustomizer imports) {
-		imports.addImports("javax.annotation.PostConstruct", "javax.annotation.PreDestroy", "groovy.util.logging.Log",
+		imports.addImports("jakarta.annotation.PostConstruct", "jakarta.annotation.PreDestroy", "groovy.util.logging.Log",
 				"org.springframework.stereotype.Controller", "org.springframework.stereotype.Service",
 				"org.springframework.stereotype.Component", "org.springframework.beans.factory.annotation.Autowired",
 				"org.springframework.beans.factory.annotation.Value", "org.springframework.context.annotation.Import",
diff --git a/grails-test-suite-web/src/test/groovy/org/grails/web/converters/MarshallerRegistrarSpec.groovy b/grails-test-suite-web/src/test/groovy/org/grails/web/converters/MarshallerRegistrarSpec.groovy
index 7993a8d1b31..09e377c1459 100644
--- a/grails-test-suite-web/src/test/groovy/org/grails/web/converters/MarshallerRegistrarSpec.groovy
+++ b/grails-test-suite-web/src/test/groovy/org/grails/web/converters/MarshallerRegistrarSpec.groovy
@@ -6,7 +6,7 @@ import grails.persistence.Entity
 import grails.testing.gorm.DomainUnitTest
 import grails.testing.web.controllers.ControllerUnitTest
 
-import javax.annotation.PostConstruct
+import jakarta.annotation.PostConstruct
 import spock.lang.Specification
 
 class MarshallerRegistrarSpec extends Specification implements ControllerUnitTest, DomainUnitTest {
diff --git a/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java b/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java
index 06d3ac854f0..5fa4c81f8cf 100644
--- a/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java
+++ b/grails-web-common/src/main/groovy/org/grails/web/util/WebUtils.java
@@ -243,11 +243,11 @@ public static void cleanupIncludeRequestAttributes(HttpServletRequest request, M
      * Expose the current request URI and paths as {@link jakarta.servlet.http.HttpServletRequest}
      * attributes under the keys defined in the Servlet 2.4 specification,
      * for containers that implement 2.3 or an earlier version of the Servlet API:
-     * javax.servlet.forward.request_uri,
-     * javax.servlet.forward.context_path,
-     * javax.servlet.forward.servlet_path,
-     * javax.servlet.forward.path_info,
-     * javax.servlet.forward.query_string.
+     * jakarta.servlet.forward.request_uri,
+     * jakarta.servlet.forward.context_path,
+     * jakarta.servlet.forward.servlet_path,
+     * jakarta.servlet.forward.path_info,
+     * jakarta.servlet.forward.query_string.
      * 

Does not override values if already present, to not cause conflicts * with the attributes exposed by Servlet 2.4+ containers themselves. * @param request current servlet request diff --git a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/DefaultDataBindingSourceRegistry.groovy b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/DefaultDataBindingSourceRegistry.groovy index e65e4c97785..dc4ee8114cb 100644 --- a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/DefaultDataBindingSourceRegistry.groovy +++ b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/DefaultDataBindingSourceRegistry.groovy @@ -21,7 +21,7 @@ import grails.web.mime.MimeType import groovy.transform.Canonical import groovy.transform.CompileStatic -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct import org.grails.databinding.bindingsource.DataBindingSourceCreator import org.grails.web.util.ClassAndMimeTypeRegistry diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle index 09d37b6d371..410e71d791d 100644 --- a/grails-web-url-mappings/build.gradle +++ b/grails-web-url-mappings/build.gradle @@ -18,7 +18,7 @@ dependencies { exclude group: 'commons-lang', module:'commons-lang' exclude group: 'javassist', module:'javassist' exclude group: 'org.javassist', module: 'javassist' - exclude group: "javax.persistence", module:"persistence-api" + exclude group: "jakarta.persistence", module:"persistence-api" exclude group: 'java-persistence', module:'persistence-api' } diff --git a/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultLinkGenerator.groovy b/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultLinkGenerator.groovy index 14de639d420..ac732182329 100644 --- a/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultLinkGenerator.groovy +++ b/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultLinkGenerator.groovy @@ -26,7 +26,7 @@ import groovy.util.logging.Slf4j import org.springframework.beans.factory.annotation.Value import org.springframework.util.StringUtils -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct import java.util.regex.Pattern import grails.util.Environment