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

Stop Spring Bom from being applied twice #348

Open
codeconsole opened this issue Nov 4, 2024 · 3 comments
Open

Stop Spring Bom from being applied twice #348

codeconsole opened this issue Nov 4, 2024 · 3 comments

Comments

@codeconsole
Copy link
Contributor

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

protected void applyDefaultPlugins(Project project) {
applySpringBootPlugin(project)
Plugin dependencyManagementPlugin = project.plugins.findPlugin(DependencyManagementPlugin)
if (dependencyManagementPlugin == null) {
project.plugins.apply(DependencyManagementPlugin)
}
DependencyManagementExtension dme = project.extensions.findByType(DependencyManagementExtension)
applyBomImport(dme, project)
}

@matrei
Copy link
Contributor

matrei commented Nov 4, 2024

Yes, the org.springframework.boot:spring-boot-dependencies bom will already be added by

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 codeconsole changed the title Confirm if Spring Bom is being applied twice Stop Spring Bom from being applied twice Nov 9, 2024
@codeconsole
Copy link
Contributor Author

@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.

@codeconsole
Copy link
Contributor Author

it turns out grails-bom is being applied twice so that means the spring-bom is being applied 3 times 😮

asset-pipeline-grails-5.0.5.pom

<dependencyManagement>
<dependencies>
  <dependency>
      <groupId>org.grails</groupId>
      <artifactId>grails-bom</artifactId>
      <version>7.0.0-SNAPSHOT</version>
      <scope>import</scope>
      <type>pom</type>
  </dependency>
  <dependency>
      <groupId>org.grails</groupId>
      <artifactId>grails-bom</artifactId>
      <version>7.0.0-SNAPSHOT</version>
      <scope>import</scope>
      <type>pom</type>
  </dependency>
  <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-dependencies</artifactId>
      <version>3.3.5</version>
      <scope>import</scope>
      <type>pom</type>
  </dependency>
</dependencies>
</dependencyManagement>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants