diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 48a71129..8718e751 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,7 +24,7 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - arguments: build + arguments: build -x test -x integrationTest publish_documentation: name: Publish Snapshot release runs-on: ubuntu-latest diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index dfdbccc0..18cbf655 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -22,4 +22,21 @@ dependencies { runtimeOnly buildsrcLibs.grails.gradle.plugin runtimeOnly buildsrcLibs.grails.views.gradle.plugin runtimeOnly buildsrcLibs.groovydoc.gradle.plugin +} + +def groovyVersion = project.rootProject + .extensions + .getByType(VersionCatalogsExtension.class) + .named("libs") + .findVersion("groovy") + .get() + .displayName + +configurations.configureEach { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + if ((details.requested.group == 'org.codehaus.groovy' || details.requested.group == 'org.apache.groovy') && details.requested.name != 'groovy-bom') { + details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: groovyVersion) + details.because "The dependency coordinates are changed in Apache Groovy 4, plus ensure version" + } + } } \ No newline at end of file diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle index 6cd9ab17..80738597 100644 --- a/buildSrc/settings.gradle +++ b/buildSrc/settings.gradle @@ -3,5 +3,9 @@ dependencyResolutionManagement { buildsrcLibs { from(files('../gradle/buildsrc.libs.versions.toml')) } + + libs { + from(files('../gradle/libs.versions.toml')) + } } } \ No newline at end of file diff --git a/docs/src/main/docs/guide/events/consuming.adoc b/docs/src/main/docs/guide/events/consuming.adoc index 96db04dd..f6f7c20a 100644 --- a/docs/src/main/docs/guide/events/consuming.adoc +++ b/docs/src/main/docs/guide/events/consuming.adoc @@ -25,7 +25,7 @@ If you wish to subscribe to events dynamically or need more flexibility, then an .TotalService.groovy ---- import grails.events.bus.EventBusAware -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct ... include::{sourcedir}/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy[tags=subscriber] ---- diff --git a/examples/pubsub-demo/build.gradle b/examples/pubsub-demo/build.gradle index 32fe150d..c665eec9 100644 --- a/examples/pubsub-demo/build.gradle +++ b/examples/pubsub-demo/build.gradle @@ -2,7 +2,7 @@ plugins { id 'application' id 'groovy' id 'org.grails.grails-web' - id 'org.grails.plugins.views-json' + //id 'org.grails.plugins.views-json' error loading when following documentation and not required for test } group = 'pubsub.demo' @@ -30,12 +30,14 @@ dependencies { implementation 'org.grails:grails-web-boot' implementation 'org.grails.plugins:hibernate5' - implementation 'org.grails.plugins:views-json' + implementation libs.grails.views.json + implementation libs.grails.views.json.templates implementation 'org.springframework.boot:spring-boot-autoconfigure' implementation 'org.springframework.boot:spring-boot-starter' implementation 'org.springframework.boot:spring-boot-starter-logging' implementation 'org.springframework.boot:spring-boot-starter-tomcat' + implementation libs.micronaut.serde.jackson runtimeOnly 'com.h2database:h2' runtimeOnly 'org.apache.tomcat:tomcat-jdbc' @@ -48,4 +50,17 @@ dependencies { // Don't need groovydoc for example project tasks.named('groovydoc') { enabled = false -} \ No newline at end of file +} + +bootJar { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + +distTar { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + +distZip { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + diff --git a/gradle/buildsrc.libs.versions.toml b/gradle/buildsrc.libs.versions.toml index b00ca76d..3a0a5c04 100644 --- a/gradle/buildsrc.libs.versions.toml +++ b/gradle/buildsrc.libs.versions.toml @@ -1,7 +1,7 @@ [versions] grails = '7.0.0-SNAPSHOT' grails-gradle-plugin = '7.0.0-SNAPSHOT' -grails-views = '3.2.1' +grails-views = '4.0.0-SNAPSHOT' groovy-doc = '1.0.1' nexus-publish-gradle-plugin = '1.3.0' diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7eefa293..6c6d6d22 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,9 +3,11 @@ bytebuddy = '1.14.12' gpars = '1.2.1' grails = '7.0.0-SNAPSHOT' grails-gsp = '7.0.0-SNAPSHOT' +grails-views = '4.0.0-SNAPSHOT' groovy = '4.0.22' -gorm = '8.1.2' -javax-annotation = '1.3.2' +gorm = '9.0.0-SNAPSHOT' +jakarta-annotation-api = '3.0.0' +micronaut-serde-jackson = '2.10.2' objenesis = '3.3' rxjava = '1.3.8' rxjava2 = '2.2.21' @@ -27,7 +29,7 @@ grails-web-mvc = { module = 'org.grails:grails-web-mvc', version.ref = 'grails' grails-web-sitemesh = { module = 'org.grails:grails-web-sitemesh', version.ref = 'grails-gsp' } gpars = { module = 'org.codehaus.gpars:gpars', version.ref = 'gpars' } groovy-core = { module = 'org.apache.groovy:groovy', version.ref = 'groovy' } -javax-annotation-api = { module = 'javax.annotation:javax.annotation-api', version.ref = 'javax-annotation' } +jakarta-annotation-api = { module = 'jakarta.annotation:jakarta.annotation-api', version.ref = 'jakarta-annotation-api' } objenesis = { module = 'org.objenesis:objenesis', version.ref = 'objenesis' } rxjava = { module = 'io.reactivex:rxjava', version.ref = 'rxjava' } rxjava2 = { module = 'io.reactivex.rxjava2:rxjava', version.ref = 'rxjava2' } @@ -40,4 +42,7 @@ spring-beans = { module = 'org.springframework:spring-beans', version.ref = 'spr spring-core = { module = 'org.springframework:spring-core', version.ref = 'spring' } spring-context = { module = 'org.springframework:spring-context', version.ref = 'spring' } spring-tx = { module = 'org.springframework:spring-tx', version.ref = 'spring' } -spring-web = { module = 'org.springframework:spring-web', version.ref = 'spring' } \ No newline at end of file +spring-web = { module = 'org.springframework:spring-web', version.ref = 'spring' } +micronaut-serde-jackson = { module = 'io.micronaut.serde:micronaut-serde-jackson', version.ref = 'micronaut-serde-jackson' } +grails-views-json = { module = 'org.grails.plugins:views-json', version.ref = 'grails-views' } +grails-views-json-templates = { module = 'org.grails.plugins:views-json-templates', version.ref = 'grails-views' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index afba1092..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c7d437bb..9355b415 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +134,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..9b42019c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/grails-async-core/build.gradle b/grails-async-core/build.gradle index 27d5f924..ca3f35af 100644 --- a/grails-async-core/build.gradle +++ b/grails-async-core/build.gradle @@ -11,8 +11,9 @@ dependencies { implementation libs.groovy.core implementation libs.slf4j.api + implementation libs.jakarta.annotation.api - compileOnly libs.javax.annotation.api + compileOnly libs.jakarta.annotation.api testImplementation libs.spock.core diff --git a/grails-async-core/src/main/groovy/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.groovy b/grails-async-core/src/main/groovy/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.groovy index 813d2ace..aa343669 100644 --- a/grails-async-core/src/main/groovy/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.groovy +++ b/grails-async-core/src/main/groovy/org/grails/async/factory/future/CachedThreadPoolPromiseFactory.groovy @@ -7,7 +7,7 @@ import groovy.transform.AutoFinal import groovy.transform.CompileStatic import org.grails.async.factory.BoundPromise -import javax.annotation.PreDestroy +import jakarta.annotation.PreDestroy import java.util.concurrent.* /** diff --git a/grails-events-transform/build.gradle b/grails-events-transform/build.gradle index 5081ddfc..61e9a6db 100644 --- a/grails-events-transform/build.gradle +++ b/grails-events-transform/build.gradle @@ -22,6 +22,7 @@ dependencies { implementation libs.spring.beans implementation libs.spring.core implementation libs.spring.tx + implementation libs.jakarta.annotation.api testImplementation libs.grails.datastore.gorm.test, { // TODO: Explain why this exclusion is done (I don't know) diff --git a/grails-events-transform/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy b/grails-events-transform/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy index 4e6bfd4b..e5a80d82 100644 --- a/grails-events-transform/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy +++ b/grails-events-transform/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy @@ -11,7 +11,7 @@ import org.grails.datastore.mapping.engine.event.AbstractPersistenceEvent import org.grails.events.EventIdUtils import org.springframework.util.ReflectionUtils -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct import java.beans.Introspector import java.lang.reflect.Method diff --git a/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy b/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy index 59c17bc0..6e11e0dd 100644 --- a/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy +++ b/grails-events-transform/src/test/groovy/grails/events/ManualPubSubSpec.groovy @@ -3,7 +3,7 @@ package grails.events import grails.events.bus.EventBusAware import spock.lang.Specification -import javax.annotation.PostConstruct +import jakarta.annotation.PostConstruct import java.util.concurrent.atomic.AtomicInteger /**