-
-
Notifications
You must be signed in to change notification settings - Fork 951
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
api dependencies should have versions set, all others can use the bom #13812
Comments
Is this documented somewhere, or could you give a more detailed explanation with examples of the cause and effect? I remember you mentioning (on Slack?) that this approach aligns with Spring's standard practices, so I'm sure it's correct, but I'd like to understand the reasoning behind it more clearly. |
Example which includes the grails-bom:pom reference. The versions will not be applied unless called with
|
To make this even clearer, an application without a BOM reference: dependencies {
implementation 'org.grails:grails-shell:7.0.0-SNAPSHOT'
} yields ( compileClasspath - Compile classpath for source set 'main'.
\--- org.grails:grails-shell:7.0.0-SNAPSHOT
+--- org.slf4j:slf4j-api FAILED
+--- org.slf4j:jcl-over-slf4j FAILED
+--- org.grails:grails-bootstrap:7.0.0-SNAPSHOT
| +--- org.slf4j:slf4j-api FAILED
| +--- org.slf4j:jcl-over-slf4j FAILED
| \--- org.yaml:snakeyaml FAILED
+--- org.grails:grails-gradle-model:7.0.0-SNAPSHOT
| +--- org.slf4j:slf4j-api FAILED
| \--- org.slf4j:jcl-over-slf4j FAILED
+--- org.apache.ant:ant FAILED
+--- org.fusesource.jansi:jansi FAILED
+--- jline:jline FAILED
\--- org.springframework.boot:spring-boot-cli FAILED while with a BOM reference: dependencies {
implementation platform('org.grails:grails-bom:7.0.0-SNAPSHOT')
implementation 'org.grails:grails-shell:7.0.0-SNAPSHOT'
} yields: compileClasspath - Compile classpath for source set 'main'.
+--- org.grails:grails-bom:7.0.0-SNAPSHOT
| +--- org.grails:grails-shell:7.0.0-SNAPSHOT (c)
| +--- org.slf4j:slf4j-api:2.0.16 (c)
| +--- org.slf4j:jcl-over-slf4j:2.0.16 (c)
| +--- org.grails:grails-bootstrap:7.0.0-SNAPSHOT (c)
| +--- org.grails:grails-gradle-model:7.0.0-SNAPSHOT (c)
| +--- org.apache.ant:ant:1.10.15 (c)
| +--- org.fusesource.jansi:jansi:1.18 (c)
| +--- jline:jline:2.14.6 (c)
| +--- org.springframework.boot:spring-boot-cli:3.3.5 (c)
| \--- org.yaml:snakeyaml:2.2 (c)
\--- org.grails:grails-shell:7.0.0-SNAPSHOT
+--- org.slf4j:slf4j-api -> 2.0.16
+--- org.slf4j:jcl-over-slf4j -> 2.0.16
| \--- org.slf4j:slf4j-api:2.0.16
+--- org.grails:grails-bootstrap:7.0.0-SNAPSHOT
| +--- org.slf4j:slf4j-api -> 2.0.16
| +--- org.slf4j:jcl-over-slf4j -> 2.0.16 (*)
| \--- org.yaml:snakeyaml -> 2.2
+--- org.grails:grails-gradle-model:7.0.0-SNAPSHOT
| +--- org.slf4j:slf4j-api -> 2.0.16
| \--- org.slf4j:jcl-over-slf4j -> 2.0.16 (*)
+--- org.apache.ant:ant -> 1.10.15
| \--- org.apache.ant:ant-launcher:1.10.15
+--- org.fusesource.jansi:jansi -> 1.18
+--- jline:jline -> 2.14.6
\--- org.springframework.boot:spring-boot-cli -> 3.3.5 To use the Grails libraries without explicitly defining |
Is it the case that this is only true for dependencies with api? |
@jeffscottbrown yes, it is only for situations where a project is not using the bom and trying to resolve the dependencies transitively. This won't happen for most applications because the grails-gradle-plugin automatically adds the bom. |
Thank you. |
Is this a different problem?...
|
@jeffscottbrown it is the same problem, but it is happening because you are not using the |
I misunderstood the bug report, but that clarity helps. It surprised me that this couldn't manifest with a dependency other than "api" so I tested it. Thank you. |
#13817 solves this issue and probably even probably fixes the @jeffscottbrown issue. @jeffscottbrown can you try running your example again with the latest snapshot? |
I have run with the build file mentioned above and the compileJava task yields the following in my environment using Java 11:
With Java 17 compileJava appears to succeed. |
@jeffscottbrown Grails 7 required Java 17+ That is also the minimum requirement for Spring Framework 6 |
I don't know if I like the bom api strategy. I think this might be better solved by adding the versions manually back in during pom generation. |
Feature description
All dependencies with
api
need a version set or they end up with a pom with no version set.All other dependencies that are in the bom do not need a version set.
The text was updated successfully, but these errors were encountered: