Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0d83ba8

Browse files
authored
Merge pull request #774 from grails/more-grails-7-updates
Use grails-bom, ContainerGebSpec, cleanup dependencies and fix tests
2 parents 9de950f + 2e30bf9 commit 0d83ba8

File tree

24 files changed

+206
-551
lines changed

24 files changed

+206
-551
lines changed

.github/renovate.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
],
2121
"groupName": "junit-jupiter monorepo"
2222
},
23-
{
24-
"matchPackageNames": [
25-
"io.netty:netty-transport",
26-
"io.netty:netty-handler",
27-
"io.netty:netty-codec"
28-
],
29-
"groupName": "netty monorepo"
30-
},
3123
{
3224
"matchPackageNames": [
3325
"org.grails:grails-datastore-core",

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
env:
3838
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
3939
with:
40-
arguments: build -Dgeb.env=chromeHeadless -x test -x integrationTest
40+
arguments: build
4141
publish:
4242
runs-on: ubuntu-latest
4343
if: github.event_name == 'push'

.github/workflows/groovy-joint-workflow.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,4 @@ jobs:
161161
with:
162162
arguments: |
163163
build
164-
-Dgeb.env=chromeHeadless
165-
-x groovydoc
166-
-x test
167-
-x integrationTest
164+
-x groovydoc

boot-plugin/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
dependencies {
2-
compileOnly "org.grails:grails-shell:$grailsShellVersion", {
2+
implementation platform("org.grails:grails-bom:$grailsVersion")
3+
compileOnly "org.grails:grails-shell", {
34
exclude group:'org.apache.groovy', module:'groovy'
45
}
56

6-
api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion"
7-
api "org.apache.groovy:groovy:$groovyVersion"
7+
api "org.springframework.boot:spring-boot-autoconfigure"
8+
api "org.apache.groovy:groovy"
89
api project(":grails-datastore-gorm-mongodb"), {
910
exclude group:'org.grails', module:'grails-datastore-gorm-plugin-support'
1011
}
1112
api project(":grails-datastore-gorm-mongodb-ext"), {
1213
exclude group:'org.grails', module:'grails-datastore-gorm-mongodb'
1314
}
14-
api "org.springframework:spring-tx:$springVersion"
15-
testImplementation "org.grails:grails-shell:$grailsShellVersion", {
15+
api "org.springframework:spring-tx"
16+
testImplementation "org.grails:grails-shell", {
1617
exclude group:'org.apache.groovy', module:'groovy'
1718
}
1819
}

build.gradle

Lines changed: 18 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ buildscript {
66
dependencies {
77
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
88
classpath "org.asciidoctor:asciidoctor-gradle-jvm:$asciidoctorGradleVersion"
9-
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesPluginVersion"
109
classpath "io.github.gradle-nexus:publish-plugin:$gradleNexusPublishPluginVersion"
1110
}
1211
}
@@ -17,7 +16,6 @@ group "org.grails"
1716
version project.projectVersion
1817

1918
ext {
20-
hibernatePluginVersion = project.hibernatePluginVersion
2119
isCiBuild = project.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean
2220
isBuildSnapshot = project.version.endsWith("-SNAPSHOT")
2321
isReleaseVersion = !isBuildSnapshot
@@ -56,7 +54,6 @@ allprojects {
5654
ext.groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: project.groovyVersion
5755

5856
repositories {
59-
mavenLocal()
6057
mavenCentral()
6158
maven { url = 'https://repo.grails.org/grails/core' }
6259
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
@@ -69,18 +66,11 @@ allprojects {
6966
url = 'https://repository.apache.org/content/repositories/snapshots'
7067
}
7168
}
69+
// mavenLocal() // do not commit uncommented, for local testing only
7270
}
7371
}
7472

7573
subprojects { Project subproject ->
76-
77-
ext['h2.version'] = h2Version
78-
ext['gorm.version'] = datastoreVersion
79-
ext['gorm.hibernate5.version'] = hibernatePluginVersion
80-
ext['junit-jupiter.version'] = junitJupiterVersion
81-
ext['spock.version'] = spockVersion
82-
ext['mongodb.version'] = mongodbDriverVersion
83-
8474
if (project.name.startsWith("examples")) {
8575

8676
apply plugin: 'groovy'
@@ -91,39 +81,19 @@ subprojects { Project subproject ->
9181
apply plugin:"org.grails.grails-gsp"
9282
}
9383

94-
boolean usesGeb = project.name.contains('grails3-hibernate5-mongodb') || project.name.contains('grails3-mongodb') || project.name.contains('grails3-mongodb-database-per-tenant')|| project.name.contains('grails3-rxmongodb')
95-
96-
if (usesGeb) {
97-
apply plugin:"com.github.erdi.webdriver-binaries"
98-
}
99-
10084
if (project.name == "examples-test-data-service") {
10185
apply plugin:"org.grails.grails-web"
10286
}
10387

104-
configurations.configureEach {
105-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
106-
if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) {
107-
details.useVersion(groovyVersion)
108-
} else if (details.requested.group == 'org.mongodb' && details.requested.module.name != 'mongodb-driver-rx') {
109-
details.useVersion(mongodbDriverVersion)
110-
} else if (details.requested.group == 'org.springframework') {
111-
details.useVersion(springVersion)
112-
} else if (details.requested.group == "org.springframework.boot") {
113-
details.useVersion(springBootVersion)
114-
}
115-
}
116-
}
117-
11888
dependencies {
119-
testImplementation "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion"
89+
implementation platform("org.grails:grails-bom:$grailsVersion")
12090
testImplementation "io.micrometer:micrometer-core:latest.integration"
121-
testImplementation "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
122-
testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion"
123-
testImplementation "org.spockframework:spock-core:$spockVersion", { transitive = false }
124-
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
125-
testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion"
126-
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
91+
testImplementation "org.hibernate.validator:hibernate-validator"
92+
testImplementation "org.apache.groovy:groovy-test-junit5"
93+
testImplementation "org.spockframework:spock-core", { transitive = false }
94+
testImplementation "org.junit.jupiter:junit-jupiter-api"
95+
testImplementation "org.junit.platform:junit-platform-runner"
96+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
12797
}
12898

12999
tasks.withType(Test) {
@@ -220,56 +190,17 @@ subprojects { Project subproject ->
220190
withSourcesJar()
221191
}
222192

223-
configurations {
224-
all {
225-
resolutionStrategy {
226-
force "org.apache.groovy:groovy:$groovyVersion"
227-
force "org.apache.groovy:groovy-dateutil:$groovyVersion"
228-
force "org.apache.groovy:groovy-xml:$groovyVersion"
229-
force "org.apache.groovy:groovy-templates:$groovyVersion"
230-
}
231-
}
232-
}
233-
234-
configurations.all {
235-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
236-
def dependencyName = details.requested.name
237-
if (dependencyName.startsWith('mongodb-driver') && !dependencyName.contains('-rx')) {
238-
details.useVersion(mongodbDriverVersion)
239-
} else if( details.requested.group == 'org.grails' &&
240-
details.requested.name in ['grails-datastore-core',
241-
'grails-datastore-async',
242-
'grails-datastore-gorm',
243-
'grails-datastore-gorm-async',
244-
'grails-datastore-gorm-rx',
245-
'grails-datastore-gorm-support',
246-
'grails-datastore-gorm-tck',
247-
'grails-datastore-gorm-test',
248-
'grails-datastore-gorm-validation',
249-
'grails-datastore-web']
250-
) {
251-
details.useVersion(datastoreVersion)
252-
} else if (details.requested.group == 'org.mongodb' && details.requested.module.name != 'mongodb-driver-rx') {
253-
details.useVersion(mongodbDriverVersion)
254-
} else if(details.requested.group == 'org.springframework') {
255-
details.useVersion(springVersion)
256-
} else if (details.requested.group == 'org.springframework.boot') {
257-
details.useVersion(springBootVersion)
258-
}
259-
}
260-
}
261-
262193
dependencies {
263-
api "org.apache.groovy:groovy:$groovyVersion"
264-
api "org.apache.groovy:groovy-templates:$groovyVersion"
265-
266-
testImplementation "org.apache.groovy:groovy-json:$groovyVersion"
267-
testImplementation "org.apache.groovy:groovy-templates:$groovyVersion"
268-
testImplementation "org.apache.groovy:groovy-test-junit5:$groovyVersion"
269-
testImplementation "org.spockframework:spock-core:$spockVersion", { transitive = false }
270-
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
271-
testImplementation "org.junit.platform:junit-platform-runner:$junitJupiterPlatformVersion"
272-
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
194+
api "org.apache.groovy:groovy"
195+
api "org.apache.groovy:groovy-templates"
196+
197+
testImplementation "org.apache.groovy:groovy-json"
198+
testImplementation "org.apache.groovy:groovy-templates"
199+
testImplementation "org.apache.groovy:groovy-test-junit5"
200+
testImplementation "org.spockframework:spock-core", { transitive = false }
201+
testImplementation "org.junit.jupiter:junit-jupiter-api"
202+
testImplementation "org.junit.platform:junit-platform-runner"
203+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
273204
}
274205

275206
publishing {

docs/build.gradle

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,15 @@ configurations {
2525
}
2626
}
2727

28-
configurations.all {
29-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
30-
if (details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) {
31-
details.useVersion(groovyVersion)
32-
} else if (details.requested.group == 'org.springframework') {
33-
details.useVersion(springVersion)
34-
} else if (details.requested.group == "org.springframework.boot") {
35-
details.useVersion(springBootVersion)
36-
} else if (details.requested.group == 'org.springframework.boot') {
37-
details.useVersion(springBootVersion)
38-
}
39-
}
40-
}
4128

4229
dependencies {
43-
documentation "org.fusesource.jansi:jansi:$jansiVersion"
44-
documentation "org.apache.groovy:groovy:$groovyVersion"
45-
documentation "org.apache.groovy:groovy-templates:$groovyVersion"
46-
documentation "org.apache.groovy:groovy-dateutil:$groovyVersion"
47-
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
30+
documentation "org.fusesource.jansi:jansi"
31+
documentation "org.apache.groovy:groovy"
32+
documentation "org.apache.groovy:groovy-templates"
33+
documentation "org.apache.groovy:groovy-dateutil"
34+
documentation "com.github.javaparser:javaparser-core"
4835
for(p in coreProjects) {
49-
documentation "org.grails:grails-datastore-$p:$datastoreVersion"
36+
documentation "org.grails:grails-datastore-$p"
5037
}
5138
project.rootProject.subprojects.findAll { !it.name.contains('-rx-') }.each { subproject ->
5239
if(subproject.name != "docs" && !subproject.name.startsWith('examples')) {
Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,42 @@
1+
plugins {
2+
id "com.bertramlabs.asset-pipeline" version "5.0.4"
3+
}
4+
15
group "examples"
26

37
dependencies {
4-
implementation "org.springframework.boot:spring-boot-starter-logging"
8+
9+
implementation project(":grails-plugin")
10+
implementation "org.mongodb:mongodb-driver-sync"
11+
testImplementation "org.testcontainers:mongodb:$testcontainersMongodbVersion"
12+
implementation "org.grails.plugins:hibernate5"
13+
14+
implementation "org.grails:grails-core"
15+
implementation "org.grails:grails-logging"
16+
implementation "org.grails:grails-plugin-databinding"
17+
implementation "org.grails:grails-plugin-i18n"
18+
implementation "org.grails:grails-plugin-interceptors"
19+
implementation "org.grails:grails-plugin-rest"
20+
implementation "org.grails:grails-plugin-services"
21+
implementation "org.grails:grails-plugin-url-mappings"
22+
implementation "org.grails:grails-web-boot"
23+
implementation "org.grails.plugins:gsp"
24+
implementation "org.grails.plugins:scaffolding"
525
implementation "org.springframework.boot:spring-boot-autoconfigure"
26+
implementation "org.springframework.boot:spring-boot-starter"
627
implementation "org.springframework.boot:spring-boot-starter-actuator"
28+
implementation "org.springframework.boot:spring-boot-starter-logging"
729
implementation "org.springframework.boot:spring-boot-starter-tomcat"
8-
implementation "jakarta.servlet:jakarta.servlet-api:$servletApiVersion"
9-
implementation "org.grails:grails-core:$grailsVersion"
10-
implementation "org.grails:grails-dependencies:$grailsVersion", {
11-
exclude module:'grails-datastore-simple'
12-
}
13-
implementation "org.grails:grails-web-boot:$grailsVersion"
14-
implementation "org.mongodb:mongodb-driver-sync:$mongodbDriverVersion"
15-
implementation project(":grails-plugin")
16-
implementation "org.grails.plugins:hibernate5:$hibernatePluginVersion"
17-
implementation "org.hibernate:hibernate-ehcache:$hibernateCoreVersion"
18-
19-
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion"
20-
runtimeOnly "com.h2database:h2:$h2Version"
21-
runtimeOnly "org.apache.tomcat:tomcat-jdbc:$tomcatVersion"
22-
runtimeOnly "org.grails.plugins:scaffolding:$scaffoldingVersion"
23-
runtimeOnly "org.grails.plugins:fields:$fieldsVersion"
24-
25-
testImplementation "org.grails:grails-gorm-testing-support:$grailsTestingSupportVersion"
26-
testImplementation "org.grails:grails-web-testing-support:$grailsTestingSupportVersion"
27-
testImplementation "org.testcontainers:mongodb:$testcontainersMongodbVersion"
28-
testImplementation "io.netty:netty-transport:$nettyVersion"
29-
testImplementation "io.netty:netty-codec:$nettyVersion"
30-
testImplementation "io.netty:netty-handler:$nettyVersion"
31-
testImplementation "org.grails.plugins:geb:$gebPluginVersion", {
32-
exclude group: 'org.gebish', module: 'geb-spock'
33-
}
34-
implementation "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesPluginVersion"
35-
testImplementation("org.grails.plugins:geb:$gebPluginVersion") {
36-
exclude group: 'org.gebish', module: 'geb-spock'
37-
}
38-
testImplementation "org.gebish:geb-spock:$gebVersion"
39-
40-
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
41-
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
42-
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"
43-
44-
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
45-
testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
46-
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
47-
}
48-
49-
tasks.withType(Test) {
50-
systemProperty "geb.env", System.getProperty('geb.env')
51-
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
52-
if (!System.getenv().containsKey('CI')) {
53-
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
54-
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
55-
} else {
56-
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
57-
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
58-
}
30+
implementation "org.springframework.boot:spring-boot-starter-validation"
31+
console "org.grails:grails-console"
32+
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails"
33+
runtimeOnly "com.h2database:h2"
34+
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
35+
runtimeOnly "org.fusesource.jansi:jansi"
36+
integrationTestImplementation testFixtures("org.grails.plugins:geb")
37+
testImplementation "org.grails:grails-gorm-testing-support"
38+
testImplementation "org.grails:grails-web-testing-support"
39+
testImplementation "org.spockframework:spock-core"
5940
}
6041

61-
webdriverBinaries {
62-
if (!System.getenv().containsKey('CI')) {
63-
chromedriver "$chromeDriverVersion"
64-
geckodriver "$geckodriverVersion"
65-
}
66-
}
67-
//compileGroovy.groovyOptions.forkOptions.jvmArgs = ['-Xdebug','-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']
68-
69-
70-
42+
//compileGroovy.groovyOptions.forkOptions.jvmArgs = ['-Xdebug','-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']

examples/grails3-hibernate5-mongodb/src/integration-test/groovy/functional/tests/AuthorControllerSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package functional.tests
22

3-
import geb.spock.GebSpec
3+
import grails.plugin.geb.ContainerGebSpec
44
import grails.testing.mixin.integration.Integration
55

66
@Integration(applicationClass = Application)
7-
class AuthorControllerSpec extends GebSpec {
7+
class AuthorControllerSpec extends ContainerGebSpec {
88

99
void "Test list authors"() {
1010
when:"The home page is visited"

examples/grails3-hibernate5-mongodb/src/integration-test/groovy/functional/tests/BookControllerSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package functional.tests
22

3-
import geb.spock.GebSpec
3+
import grails.plugin.geb.ContainerGebSpec
44
import grails.testing.mixin.integration.Integration
55

66
@Integration(applicationClass = Application)
7-
class BookControllerSpec extends GebSpec {
7+
class BookControllerSpec extends ContainerGebSpec {
88

99
void "Test list books"() {
1010
when:"The home page is visited"

0 commit comments

Comments
 (0)