Skip to content

Commit

Permalink
Merge pull request #13974 from jdaugherty/7.0.x
Browse files Browse the repository at this point in the history
Ensure example projects always use the project in grails-core instead of the published version
  • Loading branch information
jdaugherty authored Jan 15, 2025
2 parents d21ebe8 + 2478c54 commit 2367d62
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ subprojects { subproject ->
group = 'org.grails'
}

if(isExample) {
// Test projects will often include dependencies from grails-core, this file will ensure any dependencies included
// will be substituted with projects in this repository instead of pulling upstream
configurations.all {
resolutionStrategy {
dependencySubstitution {
for (def possibleProject : rootProject.subprojects) {
if(!possibleProject.name.startsWith('grails-test-suite') && !possibleProject.name.contains('grails-test-examples') && possibleProject.name != 'grails-bom') {
def artifactId = mappedArtifactIds[possibleProject.name] ?: possibleProject.name
substitute module("${subproject.name in ['grails-async-plugin', 'grails-events-plugin'] ? 'org.grails.plugins' : 'org.grails'}:${artifactId}") using project(":${possibleProject.name}")
}
}
}
}
}
}

ext.pomInfo = {
delegate.name 'Grails® framework'
delegate.description 'Grails Web Application Framework'
Expand Down
29 changes: 12 additions & 17 deletions grails-test-examples/async-events-pubsub-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@ apply plugin: "org.grails.grails-gsp"
dependencies {
implementation platform(project(':grails-bom'))

implementation project(':grails-async-plugin')
implementation project(':grails-events-plugin')
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:events"

implementation project(':grails-core')
implementation project(':grails-logging')
implementation project(':grails-plugin-databinding')
implementation project(':grails-plugin-interceptors')
implementation project(':grails-plugin-rest')
implementation project(':grails-plugin-services')
implementation project(':grails-plugin-url-mappings')
implementation project(':grails-web-boot')
implementation "org.grails:grails-core"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-web-boot"

implementation "org.grails.plugins:gsp"
implementation 'org.grails.plugins:views-json'
implementation 'org.grails.plugins:hibernate5', {
exclude group: 'org.grails', module: 'grails-bom'
}
implementation 'org.grails.plugins:hibernate5'

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

testImplementation 'io.micronaut.serde:micronaut-serde-jackson:2.10.2'
testImplementation 'io.micronaut:micronaut-http-client:4.6.5'
testImplementation project(':grails-test')
testImplementation 'org.grails:grails-web-testing-support', {
exclude group: 'org.grails', module: 'grails-test'
}
testImplementation 'org.grails:grails-web-testing-support'
}

bootRun {
Expand Down

0 comments on commit 2367d62

Please sign in to comment.