Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure example projects always use the project in grails-core instead of the published version #13974

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading