grails / grails-gradle-plugin

Apache License 2.0
6 stars 10 forks source link

Stop Spring Bom from being applied twice #348

Open codeconsole opened 2 weeks ago

codeconsole commented 2 weeks ago

Now that the Spring Bom is parent to grails-bom. The following code needs to be evaluated:

https://github.com/grails/grails-gradle-plugin/blob/755b810a1fc0b8c9a2b6774f0816635ac6d9afc7/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L173-L184

matrei commented 2 weeks ago

Yes, the org.springframework.boot:spring-boot-dependencies bom will already be added by https://github.com/grails/grails-gradle-plugin/blob/755b810a1fc0b8c9a2b6774f0816635ac6d9afc7/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L189

I don't know if this causes a problem, and if it does, I don't see how we can prevent it, other than not applying the SpringBootPlugin, and then to duplicating what it does ourselves (leaving out the DependencyManagementPluginAction).

codeconsole commented 1 week ago

@matrei I am imagining we can just eliminate

     Plugin dependencyManagementPlugin = project.plugins.findPlugin(DependencyManagementPlugin) 
     if (dependencyManagementPlugin == null) { 
         project.plugins.apply(DependencyManagementPlugin) 
     } 

     DependencyManagementExtension dme = project.extensions.findByType(DependencyManagementExtension) 

     applyBomImport(dme, project) 

and just apply our bom directly.