少数儿童模块的Maven依赖管理版本
让我假设我有一个父模块,并且有100个子模块,我在父模块中定义了用于所有子模块的特定版本
例如:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
</dependency>
</dependencies>
</dependencyManagement>
如果我在父pom中添加它,其所有孩子使用的模块都使用29.0-jre
但是现在我想对几个模块(儿童)使用25.0-jre版本,我应该如何管理这个模块, 我尝试在儿童模块中覆盖版本,但是我需要更改所有50个儿童模块pom.xml,还有更好的方法吗?
Lets suppose I have a parent module and it has 100 child modules, I have defined in parent module to use a specific version for all child modules
ex :
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
</dependency>
</dependencies>
</dependencyManagement>
If i add this in parent pom, all its child used modules uses 29.0-jre
But now i want to use 25.0-jre version for few modules(child), how should i manage this,
I have tried overriding version in child modules but that i need to change all 50 child module pom.xml, is there any better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与两个父型POM建立一个中间级别,其中包含对您拥有的两种模块的依赖性管理。
Establish an intermediate level with two parent POMs that contain the dependencyManagement for the two kinds of modules that you have.