From 5c70dff5ff6fdb2d334c69b3d6569b51bd1c3bdb Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Thu, 3 Oct 2024 23:06:06 -0700 Subject: [PATCH] Grails 7 --- .github/workflows/gradle.yml | 8 +++--- build.gradle | 1 + gradle.properties | 2 +- gradle/buildsrc.libs.versions.toml | 2 +- gradle/java-config.gradle | 2 +- gradle/libs.versions.toml | 27 ++++++++++--------- .../plugins/mail/MailServiceSpec.groovy | 9 ++++--- .../plugins/mail/MailConfiguration.groovy | 2 +- .../plugins/mail/MailMessageBuilder.groovy | 6 ++--- .../mail/MailMessageContentRenderer.groovy | 6 ++--- .../mail/MailMessageBuilderSpec.groovy | 12 ++++----- 11 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index cc49458..b3cea2b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,8 +7,8 @@ on: branches: - '[4-9]+.[0-9]+.x' 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 jobs: @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: true matrix: - java: [11, 17] + java: [17] steps: - uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v4 - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 - with: { java-version: 11, distribution: temurin } + with: { java-version: 17, distribution: temurin } - uses: gradle/actions/setup-gradle@v3 - name: Build Project diff --git a/build.gradle b/build.gradle index 91f0082..c16d1ed 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,7 @@ dependencies { testImplementation libs.grails.testing.support.core testImplementation libs.spock.core + integrationTestImplementation libs.groovy.xml integrationTestImplementation libs.greenmail integrationTestImplementation libs.spring.web diff --git a/gradle.properties b/gradle.properties index 475db04..0a6ed83 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.0.1-SNAPSHOT +projectVersion=5.0.0-SNAPSHOT # This prevents the Grails Gradle Plugin from unnecessarily excluding slf4j-simple in the generated POMs # https://github.com/grails/grails-gradle-plugin/issues/222 diff --git a/gradle/buildsrc.libs.versions.toml b/gradle/buildsrc.libs.versions.toml index 3374bdb..0dd107a 100644 --- a/gradle/buildsrc.libs.versions.toml +++ b/gradle/buildsrc.libs.versions.toml @@ -1,5 +1,5 @@ [versions] -grails-gradle-plugin = '6.2.0' +grails-gradle-plugin = '7.0.0-SNAPSHOT' nexus-publish-gradle-plugin = '1.3.0' [libraries] diff --git a/gradle/java-config.gradle b/gradle/java-config.gradle index f536319..52b8e49 100644 --- a/gradle/java-config.gradle +++ b/gradle/java-config.gradle @@ -1,5 +1,5 @@ java { - sourceCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 withSourcesJar() withJavadocJar() } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a4d9491..985dd31 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,14 +1,14 @@ [versions] -grails = '6.2.0' -grails-testing-support = '3.2.1' -greenmail = '1.6.15' -groovy = '3.0.21' -gsp = '6.2.1' -javamail = '1.6.2' +grails = '7.0.0-SNAPSHOT' +grails-testing-support = '4.0.0-SNAPSHOT' +greenmail = '2.0.1' +groovy = '4.0.23' +gsp = '7.0.0-SNAPSHOT' +javamail = '2.0.1' slf4j = '1.7.36' -spring = '5.3.34' -springboot = '2.7.18' -spock = '2.3-groovy-3.0' +spring = '6.1.13' +springboot = '3.3.4' +spock = '2.3-groovy-4.0' [libraries] grails-core = { module = 'org.grails:grails-core', version.ref = 'grails' } @@ -18,11 +18,12 @@ grails-testing-support-web = { module = 'org.grails:grails-web-testing-support', grails-web-common = { module = 'org.grails:grails-web-common', version.ref = 'grails' } grails-web-urlmappings = { module = 'org.grails:grails-web-url-mappings', version.ref = 'grails' } greenmail = { module = 'com.icegreen:greenmail', version.ref = 'greenmail' } -groovy-core = { module = 'org.codehaus.groovy:groovy', version.ref = 'groovy' } +groovy-core = { module = 'org.apache.groovy:groovy', version.ref = 'groovy' } grails-docs = { module = 'org.grails:grails-docs', version.ref = 'grails' } -groovy-templates = { module = 'org.codehaus.groovy:groovy-templates', version.ref = 'groovy' } -javamail-api = { module = 'javax.mail:javax.mail-api', version.ref = 'javamail' } -javamail-impl = { module = 'com.sun.mail:javax.mail', version.ref = 'javamail' } +groovy-templates = { module = 'org.apache.groovy:groovy-templates', version.ref = 'groovy' } +groovy-xml = { module = 'org.apache.groovy:groovy-xml', version.ref = 'groovy' } +javamail-api = { module = 'jakarta.mail:jakarta.mail-api', version.ref = 'javamail' } +javamail-impl = { module = 'com.sun.mail:jakarta.mail', version.ref = 'javamail' } slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j' } spring-beans = { module = 'org.springframework:spring-beans', version.ref = 'spring' } spring-context = { module = 'org.springframework:spring-context', version.ref = 'spring' } diff --git a/src/integration-test/groovy/grails/plugins/mail/MailServiceSpec.groovy b/src/integration-test/groovy/grails/plugins/mail/MailServiceSpec.groovy index e0d7817..2e91218 100644 --- a/src/integration-test/groovy/grails/plugins/mail/MailServiceSpec.groovy +++ b/src/integration-test/groovy/grails/plugins/mail/MailServiceSpec.groovy @@ -19,6 +19,7 @@ package grails.plugins.mail import com.icegreen.greenmail.util.GreenMail import com.icegreen.greenmail.util.ServerSetupTest import grails.testing.mixin.integration.Integration +import groovy.xml.XmlSlurper import org.grails.io.support.ClassPathResource import org.springframework.core.io.FileSystemResource import org.springframework.mail.MailMessage @@ -32,10 +33,10 @@ import spock.lang.Ignore import spock.lang.Shared import spock.lang.Specification -import javax.mail.Message -import javax.mail.internet.MimeBodyPart -import javax.mail.internet.MimeMessage -import javax.mail.internet.MimeMultipart +import jakarta.mail.Message +import jakarta.mail.internet.MimeBodyPart +import jakarta.mail.internet.MimeMessage +import jakarta.mail.internet.MimeMultipart @Integration class MailServiceSpec extends Specification { diff --git a/src/main/groovy/grails/plugins/mail/MailConfiguration.groovy b/src/main/groovy/grails/plugins/mail/MailConfiguration.groovy index 4e0c1f1..df02c86 100644 --- a/src/main/groovy/grails/plugins/mail/MailConfiguration.groovy +++ b/src/main/groovy/grails/plugins/mail/MailConfiguration.groovy @@ -30,7 +30,7 @@ import org.springframework.jndi.JndiObjectFactoryBean import org.springframework.mail.MailSender import org.springframework.mail.javamail.JavaMailSenderImpl -import javax.mail.Session +import jakarta.mail.Session @Configuration @CompileStatic diff --git a/src/main/groovy/grails/plugins/mail/MailMessageBuilder.groovy b/src/main/groovy/grails/plugins/mail/MailMessageBuilder.groovy index 3153fec..e3088cf 100644 --- a/src/main/groovy/grails/plugins/mail/MailMessageBuilder.groovy +++ b/src/main/groovy/grails/plugins/mail/MailMessageBuilder.groovy @@ -31,9 +31,9 @@ import org.springframework.mail.javamail.MimeMessageHelper import org.springframework.util.Assert import org.springframework.util.StringUtils -import javax.mail.Message -import javax.mail.internet.MimeMessage -import javax.mail.internet.MimeUtility +import jakarta.mail.Message +import jakarta.mail.internet.MimeMessage +import jakarta.mail.internet.MimeUtility import java.util.concurrent.ExecutorService /** diff --git a/src/main/groovy/grails/plugins/mail/MailMessageContentRenderer.groovy b/src/main/groovy/grails/plugins/mail/MailMessageContentRenderer.groovy index daa43e5..efd4895 100644 --- a/src/main/groovy/grails/plugins/mail/MailMessageContentRenderer.groovy +++ b/src/main/groovy/grails/plugins/mail/MailMessageContentRenderer.groovy @@ -32,9 +32,9 @@ import org.springframework.web.servlet.DispatcherServlet import org.springframework.web.servlet.i18n.FixedLocaleResolver import org.springframework.web.servlet.support.RequestContextUtils -import javax.servlet.http.Cookie -import javax.servlet.http.HttpServletRequest -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.http.Cookie +import jakarta.servlet.http.HttpServletRequest +import jakarta.servlet.http.HttpServletResponse import java.lang.reflect.InvocationHandler import java.lang.reflect.Method import java.lang.reflect.Proxy diff --git a/src/test/groovy/grails/plugins/mail/MailMessageBuilderSpec.groovy b/src/test/groovy/grails/plugins/mail/MailMessageBuilderSpec.groovy index ca2a431..1fff7e9 100644 --- a/src/test/groovy/grails/plugins/mail/MailMessageBuilderSpec.groovy +++ b/src/test/groovy/grails/plugins/mail/MailMessageBuilderSpec.groovy @@ -22,12 +22,12 @@ import org.springframework.web.context.support.ServletContextResource import spock.lang.Issue import spock.lang.Specification -import javax.mail.Message -import javax.mail.Session -import javax.mail.internet.MimeMessage -import javax.mail.internet.MimeMultipart -import javax.mail.internet.MimeUtility -import javax.servlet.ServletContext +import jakarta.mail.Message +import jakarta.mail.Session +import jakarta.mail.internet.MimeMessage +import jakarta.mail.internet.MimeMultipart +import jakarta.mail.internet.MimeUtility +import jakarta.servlet.ServletContext /** * Test case for {@link MailMessageBuilder}.