Having problems with maven bom files


(Ramsés Gómez) #1

I’m using

implementation org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE

to import a maven bom file however when the pom file is generated for the artifact this gets included in the file:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.3.RELEASE</version>
<scope>runtime</scope>
</dependency>

now if I use this dependency in a maven project it fails since it is looking for a jar artifact not a pom
, is this a bug how gradle handles pom files from maven?


(uklance) #2

I would’ve expected

<dependencyManagement>
   <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-dependencies</artifactId>
      <version>2.0.3.RELEASE</version>
      <scope>import</scope>
   </dependency>
</dependencyManagement>

(Ramsés Gómez) #3

Totally agree, I wouldn’t expect it to import a jar artifact in that case, I was able to excluded it in the pom file that using dependency and that did the trick of course but it is just a workaround

so Artifact A uses the spring-boot-dependecy

Articat B (a maven project) uses A as a dependency I exclude spring-boot-dependecies and it works other wise fails


(uklance) #4

Which version of Gradle are you using? I’m assuming 4.6+?

https://docs.gradle.org/4.6/release-notes.html#bom-import


(Ramsés Gómez) #5

Yes correct I’m using 4.8…
Maybe you could also take a look at this: Having problems setting IMPROVED_POM_SUPPORT feature


(Oleksandr Gavenko) #6

IMPROVED_POM_SUPPORT is not what you want if you like to use Spring.

Spring and Gradle developers disagree on BOM semantics:


Gradle 4.6 built-in BOM resolution breaks Spring’s BOMs.


(Ramsés Gómez) #7

It is exactly what I want to use and it works fine except for that