使用插件io.spring.dependency-management
,我的依赖的一些版本是从其他依赖中扣除的
id("io.spring.dependency-management") version "1.0.6.RELEASE"
dependencyManagement {
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
}
使用
gradlew clean build install
确实使用不包含许多依赖项版本的 pom 安装 jar。
运行依赖于第一个 JAR 的另一个子模块的构建,结果为:
Errors occurred while build effective model from C:\APPLIS\HELIOSDEV\repo\com\sfr\ext_ope\library_ext_ope_admin\
0.0.1-SNAPSHOT\library_ext_ope_admin-0.0.1-SNAPSHOT.pom:
'dependencies.dependency.version' for io.github.jhipster:jhipster-framework:jar
is missing. in com.sfr.ext_ope:library_ext_ope_admin:0.0.1-SNAPSHOT
如何强制构建在生成的 pom 中添加版本?
最佳答案
搬家dependencyManagement
部分至allprojects {}
而不是 subprojects {}
在 io.spring.dependency-management:1.0.9.RELEASE
上为我的项目修复了相同的问题
关于maven - gradle 'dependencies.dependency.version' for 丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55609093/