Skip to content

Commit cb71867

Browse files
authored
Merge pull request #10506 from grails/GRAILS-10505
Fix default dependency addition not respecting the bom
2 parents 528098d + 3442db5 commit cb71867

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
132132
addDefaultProfile(project, profileConfiguration)
133133
}
134134
}
135-
136-
profileConfiguration.resolutionStrategy.eachDependency {
137-
DependencyResolveDetails details = (DependencyResolveDetails) it
138-
def group = details.requested.group ?: "org.grails.profiles"
139-
def version = details.requested.version ?: BuildSettings.grailsVersion
140-
details.useTarget(group: group, name: details.requested.name, version: version)
141-
}
142135
}
143136

144137
@CompileStatic
@@ -153,9 +146,13 @@ class GrailsGradlePlugin extends GroovyPlugin {
153146
}
154147
}
155148

149+
protected String getDefaultProfile() {
150+
'web'
151+
}
152+
156153
@CompileStatic
157154
void addDefaultProfile(Project project, Configuration profileConfig) {
158-
project.dependencies.add('profile', ":${System.getProperty("grails.profile") ?: 'web'}:")
155+
project.dependencies.add('profile', "org.grails.profiles:${System.getProperty("grails.profile") ?: defaultProfile}:")
159156
}
160157

161158
protected Task createBuildPropertiesTask(Project project) {

grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,8 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
7171

7272
}
7373

74-
@CompileDynamic
75-
@Override
76-
void addDefaultProfile(Project project, Configuration profileConfig) {
77-
project.dependencies {
78-
profile ":${System.getProperty("grails.profile") ?: 'web-plugin'}:"
79-
}
74+
protected String getDefaultProfile() {
75+
'web-plugin'
8076
}
8177

8278
/**

0 commit comments

Comments
 (0)