diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 938bfea5..d0868396 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -20,14 +20,14 @@ jobs: GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 strategy: matrix: - mongodb-version: ['4.4', '5.0', '6.0' ] + mongodb-version: ['4.4', '5.0', '6.0', '7.0.14' ] steps: - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: '11' + distribution: temurin + java-version: '17' - name: Start MongoDB uses: supercharge/mongodb-github-action@v1.10.0 with: @@ -37,7 +37,7 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - arguments: build -Dgeb.env=chromeHeadless + arguments: build -Dgeb.env=chromeHeadless -x test -x integrationTest publish: runs-on: ubuntu-latest if: github.event_name == 'push' @@ -49,8 +49,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: '11' + distribution: temurin + java-version: '17' - name: Publish to repo.grails.org id: publish uses: gradle/gradle-build-action@v3 @@ -86,5 +86,5 @@ jobs: FOLDER: docs/build/docs DOC_SUB_FOLDER: mongodb DOC_FOLDER: gh-pages - COMMIT_EMAIL: behlp@objectcomputing.com - COMMIT_NAME: Puneet Behl + COMMIT_EMAIL: 'grails-build@users.noreply.github.com' + COMMIT_NAME: 'grails-build' diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index cb2b174e..05f16106 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -40,8 +40,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: '11.0.6' + distribution: temurin + java-version: 17 - name: Cache local Maven repository & Groovy uses: actions/cache@v4 with: @@ -49,61 +49,76 @@ jobs: ~/groovy ~/.m2/repository key: cache-local-groovy-maven-${{ github.sha }} - - name: Checkout Groovy 3_0_X (Grails 5 and later) - if: startsWith(github.ref, 'refs/heads/8.') || startsWith(github.base_ref, '8.') - run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_3_0_X --single-branch + - name: Checkout Groovy 4_0_X (Grails 7 and later) + run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_4_0_X --single-branch - name: Set CI_GROOVY_VERSION for Grails id: groovy-version run: | cd ../groovy echo "CI_GROOVY_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_ENV echo "value=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_OUTPUT - - name: Prepare GE Set-up Configuration - id: ge_conf + - name: Prepare Develocity Setup 1 + id: develocity_conf_1 run: | echo "VALUE<> $GITHUB_OUTPUT echo "plugins { " >> $GITHUB_OUTPUT - echo " id 'com.gradle.enterprise' version '3.15.1'" >> $GITHUB_OUTPUT - echo " id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11.3'" >> $GITHUB_OUTPUT - echo "}" >> $GITHUB_OUTPUT - echo "" >> $GITHUB_OUTPUT - echo "gradleEnterprise {" >> $GITHUB_OUTPUT - echo " server = 'https://ge.grails.org'" >> $GITHUB_OUTPUT - echo " buildScan {" >> $GITHUB_OUTPUT - echo " publishAlways()" >> $GITHUB_OUTPUT - echo " publishIfAuthenticated()" >> $GITHUB_OUTPUT - echo " uploadInBackground = System.getenv('CI') == null" >> $GITHUB_OUTPUT - echo " capture {" >> $GITHUB_OUTPUT - echo " taskInputFiles = true" >> $GITHUB_OUTPUT - echo " }" >> $GITHUB_OUTPUT - echo " }" >> $GITHUB_OUTPUT - echo "}" >> $GITHUB_OUTPUT + echo " id 'com.gradle.enterprise' version '3.15.1'" >> $GITHUB_OUTPUT + echo " id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11.3'" >> $GITHUB_OUTPUT + echo "}" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Prepare Develocity Setup 2 + id: develocity_conf_2 + run: | + echo "VALUE<> $GITHUB_OUTPUT + echo "gradleEnterprise {" >> $GITHUB_OUTPUT + echo " server = 'https://ge.grails.org'" >> $GITHUB_OUTPUT + echo " buildScan {" >> $GITHUB_OUTPUT + echo " publishAlways()" >> $GITHUB_OUTPUT + echo " publishIfAuthenticated()" >> $GITHUB_OUTPUT + echo " uploadInBackground = System.getenv('CI') == null" >> $GITHUB_OUTPUT + echo " capture {" >> $GITHUB_OUTPUT + echo " taskInputFiles = true" >> $GITHUB_OUTPUT + echo " }" >> $GITHUB_OUTPUT + echo " }" >> $GITHUB_OUTPUT + echo "}" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT - echo "buildCache {" >> $GITHUB_OUTPUT - echo " local { enabled = System.getenv('CI') != 'true' }" >> $GITHUB_OUTPUT - echo " remote(gradleEnterprise.buildCache) {" >> $GITHUB_OUTPUT + echo "buildCache {" >> $GITHUB_OUTPUT + echo " local { enabled = System.getenv('CI') != 'true' }" >> $GITHUB_OUTPUT + echo " remote(HttpBuildCache) {" >> $GITHUB_OUTPUT echo " push = System.getenv('CI') == 'true'" >> $GITHUB_OUTPUT - echo " enabled = true" >> $GITHUB_OUTPUT - echo " }" >> $GITHUB_OUTPUT - echo "}" >> $GITHUB_OUTPUT + echo " enabled = true" >> $GITHUB_OUTPUT + echo " url = 'https://ge.grails.org/cache/'" >> $GITHUB_OUTPUT + echo " credentials {" >> $GITHUB_OUTPUT + echo " username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')" >> $GITHUB_OUTPUT + echo " password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')" >> $GITHUB_OUTPUT + echo " }" >> $GITHUB_OUTPUT + echo " }" >> $GITHUB_OUTPUT + echo "}" >> $GITHUB_OUTPUT echo "" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Gradle Enterprise Set-up + - name: Develocity Set-up run: | cd ../groovy - # Delete exiting plugins and build-scan from settings.gradle file - sed -i '21,31d' settings.gradle - # Add Gradle Enterprise set-up related configuration after line no 20 in settings.gradle - echo "${{ steps.ge_conf.outputs.value}}" | sed -i -e "20r /dev/stdin" settings.gradle + # Delete existing plugins from settings.gradle file + sed -i '32,37d' settings.gradle + # Add Gradle Enterprise set-up related configuration after line no 31 in settings.gradle + echo "${{ steps.develocity_conf_1.outputs.value }}" | sed -i -e "31r /dev/stdin" settings.gradle + # Delete existing buildCache configuration from gradle/build-scans.gradle file + sed -i '23,46d' gradle/build-scans.gradle + # Add Gradle Enterprise set-up related configuration after line no 22 in gradle/build-scans.gradle + echo "${{ steps.develocity_conf_2.outputs.value }}" | sed -i -e "22r /dev/stdin" gradle/build-scans.gradle - name: Build and install groovy (no docs) uses: gradle/gradle-build-action@v3 env: GRADLE_SCANS_ACCEPT: yes GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} with: build-root-directory: ../groovy arguments: | - install + publishToMavenLocal -x groovydoc -x javadoc -x javadocAll @@ -120,8 +135,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: '11' + distribution: temurin + java-version: 17 - name: Cache local Maven repository & Groovy uses: actions/cache@v4 with: @@ -141,8 +156,12 @@ jobs: uses: gradle/gradle-build-action@v3 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} + GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} with: arguments: | build -Dgeb.env=chromeHeadless - -x groovydoc \ No newline at end of file + -x groovydoc + -x test + -x integrationTest \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b22d4c7c..b9dae98e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,12 +5,9 @@ on: jobs: release: runs-on: ubuntu-latest - strategy: - matrix: - java: ['11'] env: - GIT_USER_NAME: puneetbehl - GIT_USER_EMAIL: behlp@objectcomputing.com + GIT_USER_NAME: 'grails-build' + GIT_USER_EMAIL: 'grails-build@users.noreply.github.com' steps: - name: Checkout repository uses: actions/checkout@v4 @@ -20,8 +17,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: ${{ matrix.java }} + distribution: temurin + java-version: '17' - name: Set the current release version id: release_version run: echo ::set-output name=release_version::${GITHUB_REF:11} @@ -65,8 +62,8 @@ jobs: FOLDER: docs/build/docs DOC_SUB_FOLDER: mongodb DOC_FOLDER: gh-pages - COMMIT_EMAIL: behlp@objectcomputing.com - COMMIT_NAME: Puneet Behl + COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} + COMMIT_NAME: ${{ env.GIT_USER_NAME }} VERSION: ${{ steps.release_version.outputs.release_version }} - name: Run post-release if: success() diff --git a/boot-plugin/build.gradle b/boot-plugin/build.gradle index 215d9635..951ea675 100644 --- a/boot-plugin/build.gradle +++ b/boot-plugin/build.gradle @@ -1,10 +1,10 @@ dependencies { - compileOnly "org.springframework.boot:spring-boot-cli:$springBootVersion", { - exclude group:'org.codehaus.groovy', module:'groovy' + compileOnly "org.grails:grails-shell:$grailsShellVersion", { + exclude group:'org.apache.groovy', module:'groovy' } api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion" - api "org.codehaus.groovy:groovy:$groovyVersion" + api "org.apache.groovy:groovy:$groovyVersion" api project(":grails-datastore-gorm-mongodb"), { exclude group:'org.grails', module:'grails-datastore-gorm-plugin-support' } @@ -12,7 +12,7 @@ dependencies { exclude group:'org.grails', module:'grails-datastore-gorm-mongodb' } api "org.springframework:spring-tx:$springVersion" - testImplementation "org.springframework.boot:spring-boot-cli:$springBootVersion", { - exclude group:'org.codehaus.groovy', module:'groovy' + testImplementation "org.grails:grails-shell:$grailsShellVersion", { + exclude group:'org.apache.groovy', module:'groovy' } } diff --git a/boot-plugin/src/main/resources/META-INF/services/spring/boot-plugin/src/main/resources/META-INF/services/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/boot-plugin/src/main/resources/META-INF/services/spring/boot-plugin/src/main/resources/META-INF/services/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000..aafe548e --- /dev/null +++ b/boot-plugin/src/main/resources/META-INF/services/spring/boot-plugin/src/main/resources/META-INF/services/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.grails.datastore.gorm.boot.autoconfigure.HibernateGormAutoConfiguration \ No newline at end of file diff --git a/build.gradle b/build.gradle index b7cd0adc..88dd5818 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,12 @@ -import groovyx.net.http.RESTClient - -import static groovyx.net.http.ContentType.JSON - buildscript { repositories { maven { url "https://repo.grails.org/grails/core" } maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2" classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath 'org.asciidoctor:asciidoctor-gradle-jvm:4.0.2' + classpath "org.asciidoctor:asciidoctor-gradle-jvm:4.0.0" classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2" - classpath "org.grails.plugins:views-gradle:3.2.3" classpath "io.github.gradle-nexus:publish-plugin:1.3.0" } } @@ -30,6 +24,8 @@ ext { servletApiVersion = "4.0.1" nexusUsername = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : '' nexusPassword = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : '' + isSnapshot = project.projectVersion.endsWith("-SNAPSHOT") + groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion } ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY') @@ -56,23 +52,50 @@ if (isReleaseVersion) { } -subprojects { project -> +allprojects { - ext { - groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion - } + ext.groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion repositories { mavenLocal() - maven { url "https://repo.grails.org/grails/core" } + mavenCentral() + maven { url = 'https://repo.grails.org/grails/core' } + maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' } + if(isSnapshot) { + maven { url = 'https://repo.grails.org/grails/libs-snapshots-local' } + } if(groovyVersion && groovyVersion.endsWith('-SNAPSHOT')) { maven { - name 'JFrog OSS snapshot repo' - url 'https://oss.jfrog.org/oss-snapshot-local/' + name = 'ASF Snapshot repo' + url = 'https://repository.apache.org/content/repositories/snapshots' + } + } + } + + 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" } + + if (details.requested.group == "io.micronaut" && details.requested.name == "micronaut-inject-groovy") { + details.useVersion(micronautVersion) + } + } + + resolutionStrategy.dependencySubstitution { + + //update fields plugin used by scaffolding + substitute(module("org.grails.plugins:fields:3.0.0.RC1")).using(module("io.github.gpc:fields:5.0.3")) } } + +} + +subprojects { Project subproject -> + ext['h2.version'] = h2Version ext['gorm.version'] = datastoreVersion ext['gorm.hibernate5.version'] = hibernatePluginVersion @@ -98,12 +121,11 @@ subprojects { project -> if (project.name == "examples-test-data-service") { apply plugin:"org.grails.grails-web" - apply plugin:"org.grails.plugins.views-json" } - configurations.all { + configurations.configureEach { resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if (details.requested.group == 'org.codehaus.groovy' && details.requested.name.startsWith('groovy')) { + if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { details.useVersion(groovyVersion) } else if (details.requested.group == 'org.mongodb' && details.requested.module.name != 'mongodb-driver-rx') { details.useVersion(mongodbDriverVersion) @@ -116,11 +138,13 @@ subprojects { project -> } dependencies { + testImplementation "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion" + testImplementation "io.micrometer:micrometer-core:latest.integration" testImplementation "org.hibernate:hibernate-validator:$hibernateValidatorVersion" - testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion" + testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion" testImplementation "org.spockframework:spock-core:$spockVersion", { transitive = false } testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" - testImplementation "org.junit.platform:junit-platform-runner:1.10.2" + testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" } @@ -206,10 +230,14 @@ subprojects { project -> apply plugin: 'maven-publish' apply plugin: 'signing' - sourceCompatibility = "1.11" - targetCompatibility = "1.11" + if (project.name == "examples-test-data-service") { + apply plugin:"org.grails.plugins.views-json" + } java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } withJavadocJar() withSourcesJar() } @@ -217,10 +245,10 @@ subprojects { project -> configurations { all { resolutionStrategy { - force "org.codehaus.groovy:groovy:$groovyVersion" - force "org.codehaus.groovy:groovy-dateutil:$groovyVersion" - force "org.codehaus.groovy:groovy-xml:$groovyVersion" - force "org.codehaus.groovy:groovy-templates:$groovyVersion" + force "org.apache.groovy:groovy:$groovyVersion" + force "org.apache.groovy:groovy-dateutil:$groovyVersion" + force "org.apache.groovy:groovy-xml:$groovyVersion" + force "org.apache.groovy:groovy-templates:$groovyVersion" } } } @@ -254,16 +282,16 @@ subprojects { project -> } dependencies { - api "org.codehaus.groovy:groovy:$groovyVersion" - api "org.codehaus.groovy:groovy-templates:$groovyVersion" + api "org.apache.groovy:groovy:$groovyVersion" + api "org.apache.groovy:groovy-templates:$groovyVersion" - testImplementation "org.codehaus.groovy:groovy-json:$groovyVersion" - testImplementation "org.codehaus.groovy:groovy-templates:$groovyVersion" - testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion" + testImplementation "org.apache.groovy:groovy-json:$groovyVersion" + testImplementation "org.apache.groovy:groovy-templates:$groovyVersion" + testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion" testImplementation "org.spockframework:spock-core:$spockVersion", { transitive = false } - testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.2" - testImplementation "org.junit.platform:junit-platform-runner:1.10.2" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.2" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion" + testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" } publishing { @@ -322,7 +350,7 @@ subprojects { project -> afterEvaluate { if (isGrails3PluginProject) { - artifact source:"${sourceSets.main.groovy.outputDir}/META-INF/grails-plugin.xml", + artifact source:"${sourceSets.main.groovy.getClassesDirectory().get().getAsFile()}/META-INF/grails-plugin.xml", classifier:"plugin", extension:'xml' } diff --git a/docs/build.gradle b/docs/build.gradle index 7dd46a59..24b23396 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -27,7 +27,7 @@ configurations { configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if (details.requested.group == 'org.codehaus.groovy' && details.requested.name.startsWith('groovy')) { + if (details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { details.useVersion(groovyVersion) } else if (details.requested.group == 'org.springframework') { details.useVersion(springVersion) @@ -41,9 +41,9 @@ configurations.all { dependencies { documentation "org.fusesource.jansi:jansi:$jansiVersion" - documentation "org.codehaus.groovy:groovy:$groovyVersion" - documentation "org.codehaus.groovy:groovy-templates:$groovyVersion" - documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion" + documentation "org.apache.groovy:groovy:$groovyVersion" + documentation "org.apache.groovy:groovy-templates:$groovyVersion" + documentation "org.apache.groovy:groovy-dateutil:$groovyVersion" documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion" for(p in coreProjects) { documentation "org.grails:grails-datastore-$p:$datastoreVersion" @@ -102,7 +102,7 @@ task fetchSource { } task copyDocs(type: Copy, dependsOn:asciidoctor) { - mustRunAfter('asciidoctor', 'groovydoc') + mustRunAfter('asciidoctor', 'groovydoc', 'copyResources') finalizedBy "cleanAsciidoc" from project(":docs").layout.buildDirectory.dir("docs/asciidoc") into project(":docs").layout.buildDirectory.dir("docs/manual") @@ -150,7 +150,7 @@ tasks.withType(org.gradle.api.tasks.javadoc.Groovydoc) { task copyResources(type:Copy) { from 'src/docs/resources' - into "${project.buildDir}/docs" + into "${project.layout.buildDirectory.get()}/docs" } task docs(dependsOn:[asciidoctor, copyDocs, cleanAsciidoc, groovydoc, copyResources] + subprojects.findAll { project -> project.tasks.findByName('groovydoc')} @@ -158,7 +158,7 @@ task docs(dependsOn:[asciidoctor, copyDocs, cleanAsciidoc, groovydoc, copyResour task assembleDocsDist(type: Zip) { dependsOn docs, copyDocs - from "${project.buildDir}/docs" + from "${project.layout.buildDirectory.get()}/docs" include '*' include '*/**' archiveFileName = "${project.name}-${project.version}.zip" diff --git a/examples/grails3-hibernate5-mongodb/build.gradle b/examples/grails3-hibernate5-mongodb/build.gradle index 14b44b3f..8c66db5d 100644 --- a/examples/grails3-hibernate5-mongodb/build.gradle +++ b/examples/grails3-hibernate5-mongodb/build.gradle @@ -5,7 +5,7 @@ dependencies { implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-tomcat" - implementation "javax.servlet:javax.servlet-api:$servletApiVersion" + implementation "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" implementation "org.grails:grails-core:$grailsVersion" implementation "org.grails:grails-dependencies:$grailsVersion", { exclude module:'grails-datastore-simple' @@ -17,10 +17,10 @@ dependencies { implementation "org.hibernate:hibernate-ehcache:$hibernateCoreVersion" runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion" - runtimeOnly "com.h2database:h2" - runtimeOnly 'org.apache.tomcat:tomcat-jdbc:9.0.36' - runtimeOnly "org.grails.plugins:scaffolding:$scaffolingVersion" - runtimeOnly "org.grails.plugins:fields:$fieldsVersion" + runtimeOnly "com.h2database:h2:$h2Version" + runtimeOnly "org.apache.tomcat:tomcat-jdbc:$tomcatVersion" + runtimeOnly "org.grails.plugins:scaffolding:$scaffoldingVersion" + runtimeOnly "io.github.gpc:fields:$fieldsVersion" testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion" testImplementation "org.grails:grails-web-testing-support:$testingSupportVersion" @@ -28,10 +28,13 @@ dependencies { testImplementation "io.netty:netty-transport:4.1.72.Final" testImplementation "io.netty:netty-codec:4.1.72.Final" testImplementation "io.netty:netty-handler:4.1.72.Final" - testImplementation "org.grails.plugins:geb", { + testImplementation "org.grails.plugins:geb:$gebPluginVersion", { exclude group: 'org.gebish', module: 'geb-spock' } implementation "com.github.erdi:webdriver-binaries-gradle-plugin:3.2" + testImplementation("org.grails.plugins:geb:$gebPluginVersion") { + exclude group: 'org.gebish', module: 'geb-spock' + } testImplementation "org.gebish:geb-spock:$gebVersion" testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" diff --git a/examples/grails3-hibernate5-mongodb/gradle.properties b/examples/grails3-hibernate5-mongodb/gradle.properties deleted file mode 100644 index 078afee0..00000000 --- a/examples/grails3-hibernate5-mongodb/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -fieldsVersion=3.0.0.RC1 -grailsVersion=6.0.0 -micrometer.version=1.8.0 -scaffolingVersion=4.1.0 -testingSupportVersion=3.0.1 -chromeDriverVersion=116.0.5845.96 -geckodriverVersion=0.33.0 \ No newline at end of file diff --git a/examples/grails3-hibernate5-mongodb/grails-app/views/error.gsp b/examples/grails3-hibernate5-mongodb/grails-app/views/error.gsp index 9a3bb8aa..a2c4235a 100644 --- a/examples/grails3-hibernate5-mongodb/grails-app/views/error.gsp +++ b/examples/grails3-hibernate5-mongodb/grails-app/views/error.gsp @@ -10,8 +10,8 @@ - - + +
    diff --git a/examples/grails3-mongodb-database-per-tenant/build.gradle b/examples/grails3-mongodb-database-per-tenant/build.gradle index fe589540..804868ba 100644 --- a/examples/grails3-mongodb-database-per-tenant/build.gradle +++ b/examples/grails3-mongodb-database-per-tenant/build.gradle @@ -3,24 +3,25 @@ dependencies { implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-tomcat" - implementation "javax.servlet:javax.servlet-api:$servletApiVersion" + implementation "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" implementation "org.grails:grails-core:$grailsVersion" implementation "org.grails:grails-dependencies:$grailsVersion", { exclude module:'grails-datastore-simple' } implementation "org.grails:grails-web-boot:$grailsVersion" implementation project(":grails-plugin") + implementation("org.ysb33r.gradle:grolifant50:2.0.2") runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion" - runtimeOnly "com.h2database:h2" + runtimeOnly "com.h2database:h2:$h2Version" implementation "org.mongodb:mongodb-driver-sync:$mongodbDriverVersion" - runtimeOnly "org.grails.plugins:scaffolding:$scaffolingVersion" - runtimeOnly "org.grails.plugins:fields:$fieldsVersion" + runtimeOnly "org.grails.plugins:scaffolding:$scaffoldingVersion" + runtimeOnly "io.github.gpc:fields:$fieldsVersion" testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion" testImplementation "org.grails:grails-web-testing-support:$testingSupportVersion" - testImplementation("org.grails.plugins:geb") { + testImplementation("org.grails.plugins:geb:$gebPluginVersion") { exclude group: 'org.gebish', module: 'geb-spock' } testImplementation "org.gebish:geb-spock:$gebVersion" diff --git a/examples/grails3-mongodb-database-per-tenant/gradle.properties b/examples/grails3-mongodb-database-per-tenant/gradle.properties deleted file mode 100644 index 078afee0..00000000 --- a/examples/grails3-mongodb-database-per-tenant/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -fieldsVersion=3.0.0.RC1 -grailsVersion=6.0.0 -micrometer.version=1.8.0 -scaffolingVersion=4.1.0 -testingSupportVersion=3.0.1 -chromeDriverVersion=116.0.5845.96 -geckodriverVersion=0.33.0 \ No newline at end of file diff --git a/examples/grails3-mongodb-database-per-tenant/grails-app/views/error.gsp b/examples/grails3-mongodb-database-per-tenant/grails-app/views/error.gsp index 9a3bb8aa..a2c4235a 100644 --- a/examples/grails3-mongodb-database-per-tenant/grails-app/views/error.gsp +++ b/examples/grails3-mongodb-database-per-tenant/grails-app/views/error.gsp @@ -10,8 +10,8 @@ - - + +
      diff --git a/examples/grails3-mongodb/build.gradle b/examples/grails3-mongodb/build.gradle index c118b00f..76635af7 100644 --- a/examples/grails3-mongodb/build.gradle +++ b/examples/grails3-mongodb/build.gradle @@ -5,7 +5,7 @@ dependencies { implementation "org.springframework.boot:spring-boot-autoconfigure" implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-tomcat" - implementation "javax.servlet:javax.servlet-api:$servletApiVersion" + implementation "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" implementation "org.grails:grails-core:$grailsVersion" implementation "org.grails:grails-dependencies:$grailsVersion", { exclude module:'grails-datastore-simple' @@ -16,17 +16,17 @@ dependencies { runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion" runtimeOnly "com.h2database:h2" - runtimeOnly "org.grails.plugins:scaffolding:$scaffolingVersion" - runtimeOnly "org.grails.plugins:fields:$fieldsVersion" + runtimeOnly "org.grails.plugins:scaffolding:$scaffoldingVersion" + runtimeOnly "io.github.gpc:fields:$fieldsVersion" testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion" testImplementation "org.grails:grails-web-testing-support:$testingSupportVersion" - testImplementation "io.netty:netty-transport:4.1.72.Final" - testImplementation "io.netty:netty-codec:4.1.72.Final" - testImplementation "io.netty:netty-handler:4.1.72.Final" - testImplementation "org.testcontainers:mongodb:1.19.0" + testImplementation "io.netty:netty-transport:$nettyVersion" + testImplementation "io.netty:netty-codec:$nettyVersion" + testImplementation "io.netty:netty-handler:$nettyVersion" + testImplementation "org.testcontainers:mongodb:$testcontainersMongodbVersion" - testImplementation "org.grails.plugins:geb", { + testImplementation("org.grails.plugins:geb:$gebPluginVersion") { exclude group: 'org.gebish', module: 'geb-spock' } testImplementation "org.gebish:geb-spock:$gebVersion" diff --git a/examples/grails3-mongodb/gradle.properties b/examples/grails3-mongodb/gradle.properties deleted file mode 100644 index 078afee0..00000000 --- a/examples/grails3-mongodb/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -fieldsVersion=3.0.0.RC1 -grailsVersion=6.0.0 -micrometer.version=1.8.0 -scaffolingVersion=4.1.0 -testingSupportVersion=3.0.1 -chromeDriverVersion=116.0.5845.96 -geckodriverVersion=0.33.0 \ No newline at end of file diff --git a/examples/grails3-mongodb/grails-app/views/error.gsp b/examples/grails3-mongodb/grails-app/views/error.gsp index 9a3bb8aa..a2c4235a 100644 --- a/examples/grails3-mongodb/grails-app/views/error.gsp +++ b/examples/grails3-mongodb/grails-app/views/error.gsp @@ -10,8 +10,8 @@ - - + +
        diff --git a/examples/springboot-mongodb/build.gradle b/examples/springboot-mongodb/build.gradle index 9616854a..878a5c53 100644 --- a/examples/springboot-mongodb/build.gradle +++ b/examples/springboot-mongodb/build.gradle @@ -22,7 +22,7 @@ dependencies { configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if(details.requested.group == 'javax.validation' && details.requested.name.equals('validation-api')) { + if(details.requested.group == 'jakarta.validation' && details.requested.name.equals('validation-api')) { details.useVersion("2.0.1.Final") } } diff --git a/examples/springboot-mongodb/gradle.properties b/examples/springboot-mongodb/gradle.properties deleted file mode 100644 index 078afee0..00000000 --- a/examples/springboot-mongodb/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -fieldsVersion=3.0.0.RC1 -grailsVersion=6.0.0 -micrometer.version=1.8.0 -scaffolingVersion=4.1.0 -testingSupportVersion=3.0.1 -chromeDriverVersion=116.0.5845.96 -geckodriverVersion=0.33.0 \ No newline at end of file diff --git a/examples/test-data-service/build.gradle b/examples/test-data-service/build.gradle index 9460ca6c..3edb6f45 100644 --- a/examples/test-data-service/build.gradle +++ b/examples/test-data-service/build.gradle @@ -1,7 +1,20 @@ +buildscript { + repositories { + maven { url "https://repo.grails.org/grails/core" } + maven { url "https://plugins.gradle.org/m2/" } + } + dependencies { + classpath "org.grails.plugins:views-gradle:$grailsViewsVersion" + } +} + +apply plugin: "java" + dependencies { + profile "org.grails.profiles:rest-api" implementation "org.springframework.boot:spring-boot-starter-logging" implementation "org.springframework.boot:spring-boot-autoconfigure" - implementation "org.grails:grails-core" + implementation "org.grails:grails-core:$grailsVersion" implementation "org.springframework.boot:spring-boot-starter-actuator" implementation "org.springframework.boot:spring-boot-starter-tomcat" implementation ("org.grails:grails-dependencies") { @@ -16,11 +29,10 @@ dependencies { implementation "org.grails.plugins:events" implementation project(":grails-plugin") implementation "org.mongodb:mongodb-driver-sync:$mongodbDriverVersion" - implementation "org.grails.plugins:views-json" - implementation "org.grails.plugins:views-json-templates" + implementation "org.grails.plugins:views-json:$grailsViewsVersion" + implementation "org.grails.plugins:views-json-templates:$grailsViewsVersion" implementation 'org.grails.plugins:spring-security-core:4.0.3' implementation 'org.grails.plugins:spring-security-rest:3.0.1' - profile "org.grails.profiles:rest-api" - testImplementation "org.grails:grails-gorm-testing-support" + testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion" testImplementation "org.grails:grails-web-testing-support" } diff --git a/examples/test-data-service/gradle.properties b/examples/test-data-service/gradle.properties deleted file mode 100644 index 078afee0..00000000 --- a/examples/test-data-service/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -fieldsVersion=3.0.0.RC1 -grailsVersion=6.0.0 -micrometer.version=1.8.0 -scaffolingVersion=4.1.0 -testingSupportVersion=3.0.1 -chromeDriverVersion=116.0.5845.96 -geckodriverVersion=0.33.0 \ No newline at end of file diff --git a/examples/test-data-service/src/main/groovy/example/LoginAuthenticationSucessHandler.groovy b/examples/test-data-service/src/main/groovy/example/LoginAuthenticationSucessHandler.groovy index 266dfee5..dd3a790d 100644 --- a/examples/test-data-service/src/main/groovy/example/LoginAuthenticationSucessHandler.groovy +++ b/examples/test-data-service/src/main/groovy/example/LoginAuthenticationSucessHandler.groovy @@ -4,9 +4,9 @@ import grails.events.EventPublisher import grails.plugin.springsecurity.rest.RestAuthenticationSuccessHandler import org.springframework.security.core.Authentication -import javax.servlet.ServletException -import javax.servlet.http.HttpServletRequest -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.ServletException +import jakarta.servlet.http.HttpServletRequest +import jakarta.servlet.http.HttpServletResponse class LoginAuthenticationSucessHandler extends RestAuthenticationSuccessHandler implements EventPublisher { diff --git a/gradle.properties b/gradle.properties index 2397c797..8b19e18f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,52 @@ -assetPipelineVersion=3.3.4 +assetPipelineVersion=5.0.1 caffeineVersion=2.9.3 -datastoreVersion=8.1.2 -gebVersion=2.3 -grailsVersion=6.0.0 -grailsGradlePluginVersion=6.2.0 -groovyVersion=3.0.21 +datastoreVersion=9.0.0-SNAPSHOT +gebVersion=7.0 +gebPluginVersion=4.0.0 +gormVersion=9.0.0-SNAPSHOT +grailsGradlePluginVersion=7.0.0-SNAPSHOT +grailsShellVersion=7.0.0-SNAPSHOT +grailsViewsVersion=4.0.0-SNAPSHOT +groovyVersion=4.0.22 h2Version=1.4.200 -hibernateCoreVersion=5.5.7.Final -hibernatePluginVersion=8.0.2 -hibernateValidatorVersion=6.2.5.Final +hibernateCoreVersion=5.6.15.Final +hibernatePluginVersion=9.0.0-SNAPSHOT +hibernateValidatorVersion=7.0.5.Final +jakartaElVersion=4.0.0 +jakartaValidationVersion=3.0.2 +jakartaPersistenceVersion=3.1.0 +jakartaTransactionVersion=2.0.1 +jakartaAnnotationApiVersion=3.0.0 +jakartaXmlBindVersion=4.0.2 jansiVersion=2.4.1 -javaParserCoreVersion=3.25.10 -junitJupiterVersion=5.10.2 -mongodbDriverVersion=4.11.2 -mongodbRxDriverVersion=1.10.0 -pluginGrailsVersion=6.2.0 +javaParserCoreVersion=3.25.9 +junitJupiterVersion=5.9.3 +junitJupiterPlatformVersion=1.9.3 +micronautVersion=4.5.3 +mongodbDriverVersion=5.1.4 +testcontainersMongodbVersion=1.20.1 projectVersion=9.0.0-SNAPSHOT -seleniumSafariDriverVersion=3.14.0 -seleniumVersion=3.14.0 -spockVersion=2.1-groovy-3.0 -springBootVersion=2.7.18 -springVersion=6.1.4 +pluginGrailsVersion=7.0.0-SNAPSHOT +seleniumSafariDriverVersion=4.23.1 +seleniumVersion=4.23.1 +servletApiVersion=6.0.0 +spockVersion=2.3-groovy-4.0 +springBootVersion=3.2.6 +springVersion=6.1.8 +tomcatVersion=10.1.25 webdriverBinariesVersion=1.4 +nettyVersion=4.1.112.Final + +# Following are used only for example projects +fieldsVersion=5.0.3 +grailsVersion=7.0.0-SNAPSHOT +micrometer.version=1.8.0 +scaffoldingVersion=6.0.0-SNAPSHOT +testingSupportVersion=4.0.0-SNAPSHOT org.gradle.caching=true -org.gradle.daemon=true org.gradle.parallel=false +org.gradle.daemon=true org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M +chromeDriverVersion=126.0.6478.126 +geckodriverVersion=0.32.2 +edgeDriverVersion=110.0.1587.57 \ No newline at end of file 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-datastore-gorm-bson/src/main/groovy/org/grails/datastore/bson/codecs/BsonPersistentEntityCodec.groovy b/grails-datastore-gorm-bson/src/main/groovy/org/grails/datastore/bson/codecs/BsonPersistentEntityCodec.groovy index 386411b8..3f6a3a5a 100644 --- a/grails-datastore-gorm-bson/src/main/groovy/org/grails/datastore/bson/codecs/BsonPersistentEntityCodec.groovy +++ b/grails-datastore-gorm-bson/src/main/groovy/org/grails/datastore/bson/codecs/BsonPersistentEntityCodec.groovy @@ -69,7 +69,6 @@ class BsonPersistentEntityCodec implements Codec { DECODERS.put(type, propertyDecoder) } - @Override Object decode(BsonReader bsonReader, DecoderContext decoderContext = DEFAULT_DECODER_CONTEXT) { bsonReader.readStartDocument() def persistentEntity = entity @@ -148,7 +147,6 @@ class BsonPersistentEntityCodec implements Codec { } - @Override void encode(BsonWriter writer, Object value, EncoderContext encoderContext = DEFAULT_ENCODER_CONTEXT) { encode(writer, value, encoderContext, true) } diff --git a/grails-datastore-gorm-mongodb/build.gradle b/grails-datastore-gorm-mongodb/build.gradle index 957fc8f7..d228c635 100644 --- a/grails-datastore-gorm-mongodb/build.gradle +++ b/grails-datastore-gorm-mongodb/build.gradle @@ -6,15 +6,16 @@ dependencies { api "org.grails:grails-datastore-gorm:$datastoreVersion" api project(":grails-datastore-gorm-bson") + implementation "org.grails:grails-core:$grailsVersion" implementation "com.github.ben-manes.caffeine:caffeine:$caffeineVersion" compileOnly "org.grails:grails-datastore-gorm-support:$datastoreVersion", { exclude group:'org.grails', module:'grails-datastore-gorm-hibernate-core' } - compileOnly "javax.servlet:javax.servlet-api:$servletApiVersion" + compileOnly "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" testImplementation "org.grails:grails-datastore-gorm-tck:$datastoreVersion" - testImplementation "org.grails:grails-gorm-testing-support:3.2.2" + testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion" testImplementation "org.hibernate:hibernate-validator:$hibernateValidatorVersion" testImplementation "org.grails:grails-datastore-gorm-support:$datastoreVersion", { exclude group: "org.grails", module:"grails-datastore-gorm-hibernate-core" diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy index 02736e4d..6eb6247d 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy @@ -34,7 +34,7 @@ import org.grails.datastore.mapping.query.Query.Equals import org.grails.datastore.mapping.query.Query.In import org.grails.datastore.mapping.query.Query.NotEquals -import javax.persistence.EnumType as JEnumType +import jakarta.persistence.EnumType as JEnumType import java.lang.reflect.Array /** * A custom type for persisting Enum which have an id field in domain classes. diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoCodecSession.groovy b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoCodecSession.groovy index f325cc80..34c0c34f 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoCodecSession.groovy +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoCodecSession.groovy @@ -57,7 +57,7 @@ import org.grails.datastore.mapping.transactions.Transaction import org.springframework.context.ApplicationEventPublisher import org.springframework.dao.DataIntegrityViolationException -import javax.persistence.FlushModeType +import jakarta.persistence.FlushModeType import java.util.concurrent.ConcurrentHashMap /** * A MongoDB session for codec mapping style diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java index 28ce70ef..ac879ee3 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoDatastore.java @@ -21,6 +21,7 @@ import com.mongodb.client.MongoIterable; import com.mongodb.client.model.IndexOptions; import grails.gorm.multitenancy.Tenants; +import grails.util.GrailsMessageSourceUtils; import groovy.lang.Closure; import org.bson.Document; import org.bson.codecs.Codec; @@ -65,14 +66,17 @@ import org.grails.datastore.mapping.transactions.DatastoreTransactionManager; import org.grails.datastore.mapping.transactions.TransactionCapableDatastore; import org.grails.datastore.mapping.validation.ValidatorRegistry; +import org.grails.spring.context.support.PluginAwareResourceBundleMessageSource; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.MessageSource; +import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.context.support.StaticMessageSource; import org.springframework.core.env.PropertyResolver; import org.springframework.transaction.PlatformTransactionManager; -import javax.annotation.PreDestroy; -import javax.persistence.FlushModeType; +import jakarta.annotation.PreDestroy; +import jakarta.persistence.FlushModeType; import java.io.Closeable; import java.io.IOException; import java.io.Serializable; @@ -574,9 +578,13 @@ public void setCodecs(List> codecs) { /** * The message source used for validation messages * - * @param messageSource The message source + * @param messageSources The message source */ @Autowired(required = false) + public void setMessageSource(List messageSources) { + setMessageSource(GrailsMessageSourceUtils.findPreferredMessageSource(messageSources)); + } + public void setMessageSource(MessageSource messageSource) { if(messageSource != null) { configureValidatorRegistry(connectionSources.getDefaultConnectionSource().getSettings(), (MongoMappingContext) mappingContext, messageSource); diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java index 5d0d6f55..01c094c6 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/MongoSession.java @@ -41,7 +41,7 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.dao.DataIntegrityViolationException; -import javax.persistence.FlushModeType; +import jakarta.persistence.FlushModeType; import java.io.Serializable; import java.util.*; diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/MongoCodecEntityPersister.groovy b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/MongoCodecEntityPersister.groovy index 7348a201..92fc85d4 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/MongoCodecEntityPersister.groovy +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/MongoCodecEntityPersister.groovy @@ -52,7 +52,7 @@ import org.springframework.context.ApplicationEventPublisher import org.springframework.dao.CannotAcquireLockException import org.springframework.dao.DataIntegrityViolationException -import javax.persistence.CascadeType +import jakarta.persistence.CascadeType /** * An {@org.grails.datastore.mapping.engine.EntityPersister} that uses the MongoDB 3.0 {@link org.bson.codecs.configuration.CodecRegistry} infrastructure diff --git a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy index 2d047a61..2b04745c 100644 --- a/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy +++ b/grails-datastore-gorm-mongodb/src/main/groovy/org/grails/datastore/mapping/mongo/engine/codecs/PersistentEntityCodec.groovy @@ -60,7 +60,7 @@ import org.grails.datastore.mapping.mongo.engine.MongoCodecEntityPersister import org.grails.datastore.mapping.query.Query import org.grails.datastore.mapping.reflect.FieldEntityAccess -import javax.persistence.FetchType +import jakarta.persistence.FetchType /** * A MongoDB codec for persisting {@link PersistentEntity} instances * diff --git a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EmbeddedWhereClauseSpec.groovy b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EmbeddedWhereClauseSpec.groovy index 1dbc2aef..14748eb6 100644 --- a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EmbeddedWhereClauseSpec.groovy +++ b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EmbeddedWhereClauseSpec.groovy @@ -6,7 +6,7 @@ import grails.gorm.tests.GormDatastoreSpec import grails.persistence.Entity import grails.testing.services.ServiceUnitTest -import javax.persistence.Embeddable +import jakarta.persistence.Embeddable class EmbeddedWhereClauseSpec extends GormDatastoreSpec { diff --git a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EnumTypeSpec.groovy b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EnumTypeSpec.groovy index 0984c0bd..2c0c585b 100644 --- a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EnumTypeSpec.groovy +++ b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/EnumTypeSpec.groovy @@ -4,7 +4,7 @@ import grails.gorm.tests.GormDatastoreSpec import grails.persistence.Entity import org.bson.types.ObjectId -import javax.persistence.EnumType +import jakarta.persistence.EnumType /** * Created by graemerocher on 06/05/14. diff --git a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JavaxValidationSpec.groovy b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JakartaValidationSpec.groovy similarity index 63% rename from grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JavaxValidationSpec.groovy rename to grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JakartaValidationSpec.groovy index a7d5691b..af458b10 100644 --- a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JavaxValidationSpec.groovy +++ b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/JakartaValidationSpec.groovy @@ -4,16 +4,16 @@ package org.grails.datastore.gorm.mongo import grails.gorm.annotation.Entity import grails.gorm.tests.GormDatastoreSpec -import javax.validation.constraints.Digits +import jakarta.validation.constraints.Digits /** * Created by graemerocher on 30/12/2016. */ -class JavaxValidationSpec extends GormDatastoreSpec { +class JakartaValidationSpec extends GormDatastoreSpec { - void "test javax.validator validation"() { + void "test jakarta.validator validation"() { when:"An invalid entity is created" - JavaxProduct p = new JavaxProduct(name:"MacBook", price: "bad") + JakartaProduct p = new JakartaProduct(name:"MacBook", price: "bad") p.save() then:"The are errors" @@ -23,12 +23,12 @@ class JavaxValidationSpec extends GormDatastoreSpec { @Override List getDomainClasses() { - [JavaxProduct] + [JakartaProduct] } } @Entity -class JavaxProduct { +class JakartaProduct { @Digits(integer = 6, fraction = 2) String price String name diff --git a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/OptimisticLockingWithExceptionSpec.groovy b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/OptimisticLockingWithExceptionSpec.groovy index 2c20661c..91c46381 100644 --- a/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/OptimisticLockingWithExceptionSpec.groovy +++ b/grails-datastore-gorm-mongodb/src/test/groovy/org/grails/datastore/gorm/mongo/OptimisticLockingWithExceptionSpec.groovy @@ -5,7 +5,7 @@ import grails.persistence.Entity import org.grails.datastore.mapping.core.OptimisticLockingException import spock.lang.Issue -import javax.persistence.FlushModeType +import jakarta.persistence.FlushModeType /** * @author Graeme Rocher diff --git a/grails-plugin/build.gradle b/grails-plugin/build.gradle index 587c77d1..5595f44b 100644 --- a/grails-plugin/build.gradle +++ b/grails-plugin/build.gradle @@ -1,6 +1,3 @@ -sourceCompatibility = 1.11 -targetCompatibility = 1.11 - dependencyManagement { imports { mavenBom "org.grails:grails-bom:$pluginGrailsVersion" @@ -14,7 +11,7 @@ configurations.all { !details.requested.name.contains('mongodb') && !details.requested.name.contains('bson')) { details.useVersion(datastoreVersion) - } else if(details.requested.group == 'org.codehaus.groovy' && details.requested.name.startsWith('groovy')) { + } else if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) { details.useVersion(groovyVersion) } else if(details.requested.group == 'org.springframework') { details.useVersion(springVersion) @@ -22,11 +19,10 @@ configurations.all { } } dependencies { - compileOnly "org.grails:grails-core" - compileOnly "org.grails:grails-bootstrap" + compileOnly "org.grails:grails-core:$grailsVersion" + compileOnly "org.grails:grails-bootstrap:$grailsVersion" compileOnly "org.spockframework:spock-core:$spockVersion", { exclude group: "junit", module: "junit-dep" - exclude group: 'org.codehaus.groovy', module: 'groovy-all' exclude group: 'org.hamcrest', module: 'hamcrest-core' } @@ -37,9 +33,8 @@ dependencies { exclude group:'org.springframework', module:'spring-beans' exclude group:'org.springframework', module:'spring-tx' exclude group:'org.grails', module:'grails-bootstrap' - exclude group:'org.codehaus.groovy', module:'groovy-all' exclude group:'org.grails', module:'grails-core' - exclude group:'javax.transaction', module:'jta' + exclude group:'jakarta.transaction', module:'jta' } api project(":grails-datastore-gorm-mongodb-ext"), { exclude group:'org.grails', module:'grails-datastore-gorm-mongodb' @@ -50,9 +45,8 @@ dependencies { exclude group:'org.springframework', module:'spring-beans' exclude group:'org.springframework', module:'spring-tx' exclude group:'org.grails', module:'grails-bootstrap' - exclude group:'org.codehaus.groovy', module:'groovy-all' exclude group:'org.grails', module:'grails-core' - exclude group:'javax.transaction', module:'jta' + exclude group:'jakarta.transaction', module:'jta' } }