ramgom
(Ramsés Gómez)
July 10, 2018, 11:29am
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?
Lance
(uklance)
July 12, 2018, 8:50am
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>
ramgom
(Ramsés Gómez)
July 12, 2018, 9:29am
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
Lance
(uklance)
July 12, 2018, 9:54am
4
Which version of Gradle are you using? I’m assuming 4.6+?
https://docs.gradle.org/4.6/release-notes.html#bom-import
ramgom
(Ramsés Gómez)
July 12, 2018, 10:23am
5
Yes correct I’m using 4.8…
Maybe you could also take a look at this: Having problems setting IMPROVED_POM_SUPPORT feature
gavenkoa
(Oleksandr Gavenko)
July 17, 2018, 6:46am
6
IMPROVED_POM_SUPPORT is not what you want if you like to use Spring.
Spring and Gradle developers disagree on BOM semantics:
opened 01:26PM - 09 Apr 18 UTC
closed 09:39AM - 11 Apr 18 UTC
in:dependency-management
a:bug
<!---
Please follow the instructions below. We receive dozens of issues every … week, so to stay productive, we will close issues that don't provide enough information.
Please open Android-related issues on the Android Issue Tracker at https://source.android.com/source/report-bugs
Please open Kotlin DSL-related issues at https://github.com/gradle/kotlin-dsl/issues
Please open Gradle Native-related issues at https://github.com/gradle/gradle-native/issues
-->
When importing the latest spring boot bom, org.springframework.boot:spring-boot-dependencies:2.0.1.RELEASE, using Gradle 4.6's IMPROVED_POM_SUPPORT, Gradle is resolving org.yaml:snakeyaml:1.20 instead of v1.19. v1.20 is a transitive dependency coming from spring framework v5.0.5, but v1.19 is explicitly declared in the bom.
### Expected Behavior
Gradle resolves snakeyaml v1.19, as stated in the bom.
### Current Behavior
Gradle resolves snakeyaml v1.20, a transitive dependency.
### Context
Trying to build a spring boot v2.0.1 app with Gradle bom support.
Here's a link to a sample app that exposes the issue:
https://github.com/pivotal-dylan-roberts/boot-2.0.1-bom-gradle
If you run the unit tests you'll see the test "contextLoads" fails due to this issue.
@wilkinsona from the spring boot team might be able to elaborate.
### Steps to Reproduce (for bugs)
1. Use the above mentioned example project (https://github.com/pivotal-dylan-roberts/boot-2.0.1-bom-gradle) OR Use spring initializr to create a new boot 2.0.1 app and update the gradle config to use native gradle bom support, instead of spring dependency-management plugin.
2. Run the tests
### Your Environment
* Build scan URL: https://gradle.com/s/c3u5v3njarqf4
Gradle 4.6 built-in BOM resolution breaks Spring’s BOMs.
ramgom
(Ramsés Gómez)
July 18, 2018, 7:13am
7
It is exactly what I want to use and it works fine except for that