admin管理员组文章数量:1026955
I have a simple library project A and I use spring dependency management.
dependencyManagement {
imports {
mavenBom("io.grpc:grpc-bom:$grpcBomVersion")
mavenBom("com.google.protobuf:protobuf-bom:$protobufBomVersion")
}
}
Generated pom file fot this project is ok, but generated gradle 'module' file, which is used by default if I import my project A into project B does not contain following code snippet:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
This behavior causes that** I need to manually add boms to project B**(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
if I use platform for library project A:
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion"))
implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
then all is ok, generated gradle .module file contains mentioned lines:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
So no need to manually import boms to project B(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
But I don't like to use platform
gradle notation in project A, cause in this case I have different versions of same transitive dependencies in project A. I don't want to exclude them manually. When I use dependency-management
plugin in project A - I see that my duplicates of transitive dependencies are gone , so prefer to use dependency-management
plugin instead of platform
, but it causes missed boms in generated gradle .module file
I have a simple library project A and I use spring dependency management.
dependencyManagement {
imports {
mavenBom("io.grpc:grpc-bom:$grpcBomVersion")
mavenBom("com.google.protobuf:protobuf-bom:$protobufBomVersion")
}
}
Generated pom file fot this project is ok, but generated gradle 'module' file, which is used by default if I import my project A into project B does not contain following code snippet:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
This behavior causes that** I need to manually add boms to project B**(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
if I use platform for library project A:
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion"))
implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
then all is ok, generated gradle .module file contains mentioned lines:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
So no need to manually import boms to project B(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
But I don't like to use platform
gradle notation in project A, cause in this case I have different versions of same transitive dependencies in project A. I don't want to exclude them manually. When I use dependency-management
plugin in project A - I see that my duplicates of transitive dependencies are gone , so prefer to use dependency-management
plugin instead of platform
, but it causes missed boms in generated gradle .module file
1 Answer
Reset to default 0This is not possible with the Spring Dependency Management plugin. See the following issue for details: https://github/spring-gradle-plugins/dependency-management-plugin/issues/342
I have a simple library project A and I use spring dependency management.
dependencyManagement {
imports {
mavenBom("io.grpc:grpc-bom:$grpcBomVersion")
mavenBom("com.google.protobuf:protobuf-bom:$protobufBomVersion")
}
}
Generated pom file fot this project is ok, but generated gradle 'module' file, which is used by default if I import my project A into project B does not contain following code snippet:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
This behavior causes that** I need to manually add boms to project B**(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
if I use platform for library project A:
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion"))
implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
then all is ok, generated gradle .module file contains mentioned lines:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
So no need to manually import boms to project B(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
But I don't like to use platform
gradle notation in project A, cause in this case I have different versions of same transitive dependencies in project A. I don't want to exclude them manually. When I use dependency-management
plugin in project A - I see that my duplicates of transitive dependencies are gone , so prefer to use dependency-management
plugin instead of platform
, but it causes missed boms in generated gradle .module file
I have a simple library project A and I use spring dependency management.
dependencyManagement {
imports {
mavenBom("io.grpc:grpc-bom:$grpcBomVersion")
mavenBom("com.google.protobuf:protobuf-bom:$protobufBomVersion")
}
}
Generated pom file fot this project is ok, but generated gradle 'module' file, which is used by default if I import my project A into project B does not contain following code snippet:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
This behavior causes that** I need to manually add boms to project B**(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
if I use platform for library project A:
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion"))
implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
then all is ok, generated gradle .module file contains mentioned lines:
"dependencies": [
{
"group": "io.grpc",
"module": "grpc-bom",
"version": {
"requires": "1.58.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
{
"group": "com.google.protobuf",
"module": "protobuf-bom",
"version": {
"requires": "3.24.0"
},
"attributes": {
".gradle.category": "platform"
},
"endorseStrictVersions": true
},
So no need to manually import boms to project B(project B imports library project A):
implementation(platform("io.grpc:grpc-bom:$grpcBomVersion")) implementation(platform("com.google.protobuf:protobuf-bom:$protobufBomVersion"))
But I don't like to use platform
gradle notation in project A, cause in this case I have different versions of same transitive dependencies in project A. I don't want to exclude them manually. When I use dependency-management
plugin in project A - I see that my duplicates of transitive dependencies are gone , so prefer to use dependency-management
plugin instead of platform
, but it causes missed boms in generated gradle .module file
1 Answer
Reset to default 0This is not possible with the Spring Dependency Management plugin. See the following issue for details: https://github/spring-gradle-plugins/dependency-management-plugin/issues/342
本文标签:
版权声明:本文标题:build.gradle - mavenBom from spring dependency-management Gradle plugin does not add bom to gradle module file - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745652333a2161392.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论