少数儿童模块的Maven依赖管理版本

发布于 2025-02-03 10:40:29 字数 546 浏览 2 评论 0原文

让我假设我有一个父模块,并且有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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖迟 2025-02-10 10:40:29

与两个父型POM建立一个中间级别,其中包含对您拥有的两种模块的依赖性管理。

Establish an intermediate level with two parent POMs that contain the dependencyManagement for the two kinds of modules that you have.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文