Skip to content

Commit

Permalink
Use dependency versions from the grails-bom where available (#57)
Browse files Browse the repository at this point in the history
* test: Add log output to tests

* fix(deps): Use `grails-bom` versions where available

* chore: Improve comment in `documentation-config.gradle`

* test: Inject `JavaMailSender` to work with Spring 6

When creating the `JavaMailSender` via constructor, it could not connect to the greenmail server.

* chore: Cleanup `MailServiceSpec`

* fix(deps): Put all dependencies in version catalog

* fix(deps): Use more versions from `grails-bom`

`groovy-templates` and `grails-docs` are also in `grails-bom`

* fix(deps): Rename `grails-gsp` version catalog entry

* fix(deps): Set correct maven coords for `grails-gsp`

* fix(deps): Rename the aliases for build dependencies

To restrict the use of groups.

* fix(deps): Use all available versions from `grails-bom`

- Remove explicit versions to where versions are available in `grails-bom`
- Use `org.eclipse.angus:jakarta.mail` instead of `com.sun.mail:jakarta.mail`
- Restrict the use of version catalog alias groups

* fix(deps): Update `com.icegreen:greenmail`

`2.0.1` -> `2.1.0`
  • Loading branch information
matrei authored Oct 25, 2024
1 parent c0a82ec commit 97b67b8
Show file tree
Hide file tree
Showing 9 changed files with 642 additions and 454 deletions.
37 changes: 21 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

version = projectVersion
group = 'org.grails.plugins'
ext.set('grailsVersion', libs.versions.grails.asProvider().get())
ext.set('grailsVersion', libs.versions.grails.get())
ext.set('isReleaseVersion', !version.toString().endsWith('-SNAPSHOT'))
ext.set('isSnapshot', !isReleaseVersion)

Expand All @@ -21,43 +21,48 @@ repositories {

dependencies {

compileOnly libs.grails.core // Used in public api, but provided
compileOnly libs.groovy.core // Used in public api, but provided
compileOnly libs.servlet.api // Provided
implementation(platform(libs.grails.bom))

compileOnly libs.servlet.api // Provided by the servlet container
compileOnly libs.grails.core // Provided as this is a Grails plugin
compileOnly libs.groovy.core // Used in public api, but Groovy is always provided

compileOnlyApi libs.javamail.api // Used in public api

api libs.javamail.api // Used in public api
api libs.spring.context // Used in public api
api libs.spring.context.support // Used in public api
api libs.spring.contextSupport // Used in public api

// These two libraries are used in public api, but not in a way
// that is meant to be consumed by users of the plugin.
// Therefore they are set to implementation to not expose unnecessarily
// to the compileClasspath of plugin users.
implementation libs.grails.gsp
implementation libs.grails.web.common
implementation libs.grails.gsp.core
implementation libs.grails.webCommon

implementation libs.grails.web.urlmappings
implementation libs.javamail.impl
implementation libs.grails.gsp.webTaglib
implementation libs.grails.webUrlmappings
implementation libs.javamail.impl // Needs to be implementation (not runtimeOnly), as SMTPMessage is used in MailMessageBuilder
implementation libs.spring.beans
implementation libs.springboot.autoconfigure

testImplementation libs.grails.testing.support.core
testRuntimeOnly libs.slf4j.simple

testImplementation libs.servlet.api
testImplementation libs.grails.testingSupport.core
testImplementation libs.spock.core

integrationTestImplementation libs.groovy.xml
integrationTestImplementation libs.greenmail
integrationTestImplementation libs.groovy.xml
integrationTestImplementation libs.spring.web

integrationTestRuntimeOnly libs.grails.testing.support.web
integrationTestRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task
integrationTestRuntimeOnly libs.springboot.starter.tomcat
integrationTestRuntimeOnly libs.springboot.starterTomcat
integrationTestRuntimeOnly libs.grails.testingSupport.web
}

tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
events 'passed', 'skipped', 'failed', 'standardError', 'standardOut'
}
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ repositories {
maven { url = 'https://repo.grails.org/grails/core' }
}
dependencies {
implementation buildsrcLibs.nexus.publish.gradle.plugin
implementation buildsrcLibs.grails.gradle.plugin
implementation buildsrcLibs.nexusPublishGradlePlugin
implementation buildsrcLibs.grailsGradlePlugin
}
4 changes: 2 additions & 2 deletions gradle/buildsrc.libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ grails-gradle-plugin = '7.0.0-SNAPSHOT'
nexus-publish-gradle-plugin = '1.3.0'

[libraries]
grails-gradle-plugin = { module = 'org.grails:grails-gradle-plugin', version.ref = 'grails-gradle-plugin' }
nexus-publish-gradle-plugin = { module = 'io.github.gradle-nexus:publish-plugin', version.ref = 'nexus-publish-gradle-plugin' }
grailsGradlePlugin = { module = 'org.grails:grails-gradle-plugin', version.ref = 'grails-gradle-plugin' }
nexusPublishGradlePlugin = { module = 'io.github.gradle-nexus:publish-plugin', version.ref = 'nexus-publish-gradle-plugin' }
2 changes: 1 addition & 1 deletion gradle/documentation-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

add('guideConfiguration', libs.grails.docs)
add('guideConfiguration', libs.groovy.templates)
add('guideConfiguration', libs.slf4j.nop) // Get rid of warning about missing slf4j implementation during docs task
add('guideConfiguration', libs.slf4j.nop) // Get rid of logs during guide generation
}

tasks.withType(Groovydoc).configureEach {
Expand Down
56 changes: 25 additions & 31 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
[versions]
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'
servlet-api = '6.0.0'
slf4j = '1.7.36'
spring = '6.1.13'
springboot = '3.3.4'
spock = '2.3-groovy-4.0'
greenmail = '2.1.0'

[libraries]
grails-core = { module = 'org.grails:grails-core', version.ref = 'grails' }
grails-gsp = { module = 'org.grails:grails-gsp', version.ref = 'gsp' }
grails-testing-support-core = { module = 'org.grails:grails-testing-support', version.ref = 'grails-testing-support' }
grails-testing-support-web = { module = 'org.grails:grails-web-testing-support', version.ref = 'grails-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' }
grails-bom = { module = 'org.grails:grails-bom', version.ref = 'grails' }
grails-core = { module = 'org.grails:grails-core' }
greenmail = { module = 'com.icegreen:greenmail', version.ref = 'greenmail' }
groovy-core = { module = 'org.apache.groovy:groovy', version.ref = 'groovy' }
grails-docs = { module = 'org.grails:grails-docs', version.ref = 'grails' }
groovy-templates = { module = 'org.apache.groovy:groovy-templates', version.ref = 'groovy' }
groovy-xml = { module = 'org.apache.groovy:groovy-xml', version.ref = 'groovy' }
servlet-api = { module = 'jakarta.servlet:jakarta.servlet-api', version.ref = 'servlet-api' }
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' }
spring-context-support = { module = 'org.springframework:spring-context-support', version.ref = 'spring' }
spring-web = { module = 'org.springframework:spring-web', version.ref = 'spring' }
springboot-autoconfigure = { module = 'org.springframework.boot:spring-boot-autoconfigure', version.ref = 'springboot' }
springboot-starter-tomcat = { module = 'org.springframework.boot:spring-boot-starter-tomcat', version.ref = 'springboot' }
spock-core = { module = 'org.spockframework:spock-core', version.ref = 'spock' }
grails-docs = { module = 'org.grails:grails-docs' }
grails-gsp-core = { module = 'org.grails:grails-gsp' }
grails-gsp-webTaglib = { module = 'org.grails:grails-web-taglib' }
grails-testingSupport-core = { module = 'org.grails:grails-testing-support' }
grails-testingSupport-web = { module = 'org.grails:grails-web-testing-support' }
grails-webCommon = { module = 'org.grails:grails-web-common' }
grails-webUrlmappings = { module = 'org.grails:grails-web-url-mappings' }
groovy-core = { module = 'org.apache.groovy:groovy' }
groovy-templates = { module = 'org.apache.groovy:groovy-templates' }
groovy-xml = { module = 'org.apache.groovy:groovy-xml' }
servlet-api = { module = 'jakarta.servlet:jakarta.servlet-api' }
javamail-api = { module = 'jakarta.mail:jakarta.mail-api' }
javamail-impl = { module = 'org.eclipse.angus:jakarta.mail' }
slf4j-nop = { module = 'org.slf4j:slf4j-nop' }
slf4j-simple = { module = 'org.slf4j:slf4j-simple' }
spock-core = { module = 'org.spockframework:spock-core' }
spring-beans = { module = 'org.springframework:spring-beans' }
spring-context = { module = 'org.springframework:spring-context' }
spring-contextSupport = { module = 'org.springframework:spring-context-support' }
spring-web = { module = 'org.springframework:spring-web' }
springboot-autoconfigure = { module = 'org.springframework.boot:spring-boot-autoconfigure' }
springboot-starterTomcat = { module = 'org.springframework.boot:spring-boot-starter-tomcat' }
Loading

0 comments on commit 97b67b8

Please sign in to comment.