Skip to content

Commit fce515f

Browse files
committed
Fix how the gorm version is derived from the bom. Fixes #11060
1 parent ce13620 commit fce515f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

grails-shell/src/main/groovy/org/grails/cli/boot/GrailsDependencyVersions.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class GrailsDependencyVersions implements DependencyManagement {
3636
protected Map<String, Dependency> groupAndArtifactToDependency = [:]
3737
protected Map<String, String> artifactToGroupAndArtifact = [:]
3838
protected List<Dependency> dependencies = []
39+
protected Map<String, String> versionProperties = [:]
3940

4041
GrailsDependencyVersions() {
4142
this(getDefaultEngine())
@@ -69,6 +70,7 @@ class GrailsDependencyVersions implements DependencyManagement {
6970
pom.dependencyManagement.dependencies.dependency.each { dep ->
7071
addDependency(dep.groupId.text(), dep.artifactId.text(), dep.version.text())
7172
}
73+
versionProperties = pom.properties.'*'.collectEntries { [(it.name()): it.text()] }
7274
}
7375

7476
protected void addDependency(String group, String artifactId, String version) {
@@ -89,6 +91,10 @@ class GrailsDependencyVersions implements DependencyManagement {
8991
return dependencies
9092
}
9193

94+
Map<String, String> getVersionProperties() {
95+
return versionProperties
96+
}
97+
9298
@Override
9399
String getSpringBootVersion() {
94100
return find("spring-boot").getVersion();

grails-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos
229229

230230
if(profileRepository instanceof MavenProfileRepository) {
231231
MavenProfileRepository mpr = (MavenProfileRepository)profileRepository
232-
org.springframework.boot.cli.compiler.dependencies.Dependency gormDep = mpr.profileDependencyVersions.find("org.grails", "grails-datastore-core")
232+
String gormDep = mpr.profileDependencyVersions.versionProperties.get('datastore.version')
233233
if(gormDep != null) {
234-
variables['gorm.version'] = gormDep.version
234+
variables['gorm.version'] = gormDep
235235
}
236236
}
237237

0 commit comments

Comments
 (0)