Skip to content

Commit

Permalink
javax to jakarta, groovy 4, spring framework 6 and spring boot 3 migr…
Browse files Browse the repository at this point in the history
…ations (#1810)

* javax to jakarta, groovy 4, spring framework 6 and spring boot 3 migrations
---------

Co-authored-by: Mattias Reichel <mattias.reichel@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: puneetbehl <behlp@objectcomputing.com>
Co-authored-by: Puneet Behl <behlp@unityfoundation.io>
Co-authored-by: Guillermo Calvo <guillermocalvo@gmail.com>
Co-authored-by: jhron <jhron@users.noreply.github.com>
Co-authored-by: micronaut-build <puneetbehl@users.noreply.github.com>
Co-authored-by: Guillermo Calvo <guillermo@guillermo.dev>
  • Loading branch information
9 people committed Aug 27, 2024
1 parent 4c03d83 commit 122ad22
Show file tree
Hide file tree
Showing 120 changed files with 601 additions and 530 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '14']
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
distribution: temurin
java-version: 17
- name: Run Build
id: build
uses: gradle/gradle-build-action@v2
Expand All @@ -35,8 +32,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
distribution: temurin
java-version: '17'
- name: Publish to Artifactory (repo.grails.org)
uses: gradle/gradle-build-action@v2
env:
Expand Down
56 changes: 37 additions & 19 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -40,32 +40,37 @@ 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@v3
uses: actions/cache@v4
with:
path: |
~/groovy
~/.m2/repository
key: cache-local-groovy-maven-${{ github.sha }}
- name: Checkout Groovy 3_0_X (Grails 5 and later)
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<<EOF" >> $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 "EOF" >> $GITHUB_OUTPUT
- name: Prepare Develocity Setup 2
id: develocity_conf_2
run: |
echo "VALUE<<EOF" >> $GITHUB_OUTPUT
echo "gradleEnterprise {" >> $GITHUB_OUTPUT
echo " server = 'https://ge.grails.org'" >> $GITHUB_OUTPUT
echo " buildScan {" >> $GITHUB_OUTPUT
Expand All @@ -80,25 +85,36 @@ jobs:
echo "" >> $GITHUB_OUTPUT
echo "buildCache {" >> $GITHUB_OUTPUT
echo " local { enabled = System.getenv('CI') != 'true' }" >> $GITHUB_OUTPUT
echo " remote(gradleEnterprise.buildCache) {" >> $GITHUB_OUTPUT
echo " remote(HttpBuildCache) {" >> $GITHUB_OUTPUT
echo " push = System.getenv('CI') == 'true'" >> $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@v2
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: |
Expand All @@ -119,10 +135,10 @@ 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@v3
uses: actions/cache@v4
with:
path: |
~/groovy
Expand All @@ -133,9 +149,11 @@ jobs:
echo "CI_GROOVY_VERSION=${{needs.build_groovy.outputs.groovyVersion}}" >> $GITHUB_ENV
- name: Build GORM
id: build_gorm
uses: gradle/gradle-build-action@v2
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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
target_branch: ${{ steps.extract_branch.outputs.value }}
runs-on: ubuntu-latest
env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@unityfoundation.io
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -19,8 +19,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
distribution: temurin
java-version: 17
- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
with:
Expand Down
48 changes: 29 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,27 @@ allprojects {
mavenLocal()
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 Groovy snapshot repo'
url = 'https://groovy.jfrog.io/artifactory/libs-snapshot-local'
name = 'ASF Snapshot repo'
url = 'https://repository.apache.org/content/repositories/snapshots'
}
}
}

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"
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"
}
}
}
}
}
Expand Down Expand Up @@ -95,8 +98,13 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'java-library'

sourceCompatibility = 1.17
targetCompatibility = 1.17

}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

def isGormDatasource = project.name.startsWith("grails-datastore-gorm-") &&
Expand All @@ -109,28 +117,30 @@ subprojects {


dependencies {
api "javax.annotation:javax.annotation-api:$javaAnnotationApiVersion"
api "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion"
implementation "jakarta.validation:jakarta.validation-api:$jakartaValidationVersion"
compileOnly "com.github.spotbugs:spotbugs-annotations:4.8.6"

if (isStandardGroovyMavenProject) {
documentation "org.fusesource.jansi:jansi:2.4.0"
documentation "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
documentation "org.apache.groovy:groovy-dateutil:$groovyVersion"
documentation 'info.picocli:picocli:4.6.3'
documentation ("com.github.javaparser:javaparser-core:$javaParserCoreVersion")

api "org.codehaus.groovy:groovy:$groovyVersion"
testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.1"
testImplementation "org.junit.platform:junit-platform-runner:1.9.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.1"
api "org.apache.groovy:groovy:$groovyVersion"
testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion"

testImplementation(spockDependency) { transitive = false }
}

if (project.name == "grails-datastore-gorm-tck") {
api "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
api "org.junit.jupiter:junit-jupiter-api:5.9.1"
api "org.junit.platform:junit-platform-runner:1.9.1"
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.1"
api "org.apache.groovy:groovy-test-junit5:$groovyVersion"
api "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
api "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion"
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
implementation(spockDependency) { transitive = false }
}
}
Expand Down
2 changes: 1 addition & 1 deletion clover.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {

test.doFirst {
if (project.hasProperty("withClover")) {
ant.taskdef(name: 'groovyc', classname:"org.codehaus.groovy.ant.Groovyc", classpath:configurations.testRuntimeClasspath.asPath)
ant.taskdef(name: 'groovyc', classname:"org.apache.groovy.ant.Groovyc", classpath:configurations.testRuntimeClasspath.asPath)
ant.taskdef(resource:"cloverlib.xml", classpath:configurations.testRuntimeClasspath.asPath)
ant.property(name:"clover.license.path", value:cloverConvention.licenseFile)

Expand Down
40 changes: 22 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ projectDesc=GORM - Grails Data Access Framework
projectUrl=https://gorm.grails.org/
projectVersion=9.0.0-SNAPSHOT
githubSlug=grails/grails-data-mapping
developers=Graeme Rocher,Jeff Brown,Burt Beckwith,James Kleeh,Puneet Behl
hibernateValidatorVersion=6.2.5.Final
jpaVersion=2.2
jtaVersion=1.1
javaAnnotationApiVersion=1.3.2
elVersion=3.0.0
commonsValidatorVersion=1.8.0
developers=Graeme Rocher,Jeff Brown,Burt Beckwith,James Kleeh,Puneet Behl,James Fredley

hibernateVersion=5.6.15.Final
servletApiVersion=4.0.1
spockVersion=2.1-groovy-3.0
springVersion=5.3.33
caffeineVersion=2.9.3
grailsVersion=6.2.0
grailsAsyncVersion=4.0.0
grailsVersion=7.0.0-SNAPSHOT
grailsAsyncVersion=5.0.2

caffeineVersion=3.1.8
commonsValidatorVersion=1.7
jakartaElVersion=4.0.0
groovyVersion=4.0.22
h2Version=2.2.224
hibernateValidatorVersion=7.0.5.Final
jakartaValidationVersion=3.0.2
javaParserCoreVersion=3.25.9
javassistVersion=3.29.2-GA
jakartaPersistenceVersion=3.1.0
jakartaTransactionVersion=2.0.1
jakartaAnnotationApiVersion=3.0.0
junitJupiterVersion=5.9.3
junitJupiterPlatformVersion=1.9.3
servletApiVersion=6.0.0
slf4jVersion=1.7.36
javaParserCoreVersion=3.15.14
junitVersion=4.12
junit-jupiter.version=5.7.0
javassistVersion=3.30.2-GA
groovyVersion=3.0.21
spockVersion=2.3-groovy-4.0
springVersion=6.1.8

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 122ad22

Please sign in to comment.