Skip to content

Commit 2367d62

Browse files
authored
Merge pull request #13974 from jdaugherty/7.0.x
Ensure example projects always use the project in grails-core instead of the published version
2 parents d21ebe8 + 2478c54 commit 2367d62

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

build.gradle

+17
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,23 @@ subprojects { subproject ->
191191
group = 'org.grails'
192192
}
193193

194+
if(isExample) {
195+
// Test projects will often include dependencies from grails-core, this file will ensure any dependencies included
196+
// will be substituted with projects in this repository instead of pulling upstream
197+
configurations.all {
198+
resolutionStrategy {
199+
dependencySubstitution {
200+
for (def possibleProject : rootProject.subprojects) {
201+
if(!possibleProject.name.startsWith('grails-test-suite') && !possibleProject.name.contains('grails-test-examples') && possibleProject.name != 'grails-bom') {
202+
def artifactId = mappedArtifactIds[possibleProject.name] ?: possibleProject.name
203+
substitute module("${subproject.name in ['grails-async-plugin', 'grails-events-plugin'] ? 'org.grails.plugins' : 'org.grails'}:${artifactId}") using project(":${possibleProject.name}")
204+
}
205+
}
206+
}
207+
}
208+
}
209+
}
210+
194211
ext.pomInfo = {
195212
delegate.name 'Grails® framework'
196213
delegate.description 'Grails Web Application Framework'

grails-test-examples/async-events-pubsub-demo/build.gradle

+12-17
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,21 @@ apply plugin: "org.grails.grails-gsp"
2424
dependencies {
2525
implementation platform(project(':grails-bom'))
2626

27-
implementation project(':grails-async-plugin')
28-
implementation project(':grails-events-plugin')
27+
implementation "org.grails.plugins:async"
28+
implementation "org.grails.plugins:events"
2929

30-
implementation project(':grails-core')
31-
implementation project(':grails-logging')
32-
implementation project(':grails-plugin-databinding')
33-
implementation project(':grails-plugin-interceptors')
34-
implementation project(':grails-plugin-rest')
35-
implementation project(':grails-plugin-services')
36-
implementation project(':grails-plugin-url-mappings')
37-
implementation project(':grails-web-boot')
30+
implementation "org.grails:grails-core"
31+
implementation "org.grails:grails-logging"
32+
implementation "org.grails:grails-plugin-databinding"
33+
implementation "org.grails:grails-plugin-interceptors"
34+
implementation "org.grails:grails-plugin-rest"
35+
implementation "org.grails:grails-plugin-services"
36+
implementation "org.grails:grails-plugin-url-mappings"
37+
implementation "org.grails:grails-web-boot"
3838

3939
implementation "org.grails.plugins:gsp"
4040
implementation 'org.grails.plugins:views-json'
41-
implementation 'org.grails.plugins:hibernate5', {
42-
exclude group: 'org.grails', module: 'grails-bom'
43-
}
41+
implementation 'org.grails.plugins:hibernate5'
4442

4543
implementation 'org.springframework.boot:spring-boot-autoconfigure'
4644
implementation 'org.springframework.boot:spring-boot-starter'
@@ -53,10 +51,7 @@ dependencies {
5351

5452
testImplementation 'io.micronaut.serde:micronaut-serde-jackson:2.10.2'
5553
testImplementation 'io.micronaut:micronaut-http-client:4.6.5'
56-
testImplementation project(':grails-test')
57-
testImplementation 'org.grails:grails-web-testing-support', {
58-
exclude group: 'org.grails', module: 'grails-test'
59-
}
54+
testImplementation 'org.grails:grails-web-testing-support'
6055
}
6156

6257
bootRun {

0 commit comments

Comments
 (0)