[英]How to manage maven Dependencies as Group?
I got the following Maven module layout: 我得到以下Maven模块布局:
I manage all my submodule versions in the 'All' as managed dependencies. 我将所有子模块版本在“全部”中作为托管依赖项进行管理。 I reference those managed dependencies in the 'Deliverable-Build' module, to include them in the final zip archive.
我在“ Deliverable-Build”模块中引用了这些托管依赖项,以将它们包括在最终的zip存档中。
The same dependency set needs to be referenced in the 'Dependency Report' module. “依赖关系报告”模块中需要引用相同的依赖关系集。
If the developer creates a new sub-module. 开发人员是否创建新的子模块。 He needs to manually put the new module into
他需要手动将新模块放入
It is easy to forget one of those, so is there a way to simplify this? 很容易忘记其中之一,那么有没有办法简化这一过程呢? eg by once defining a 'dependency group' and reusing it in those three locations?
例如,一次定义一个“依赖组”并在这三个位置重复使用它?
You cannot combine dependencyManagement and dependency lists into one whole. 您不能将dependencyManagement和依赖项列表合并为一个整体。 For no.
没有 2 and 3, you could create a pom containing all relevant dependencies and reference it, as described in
如图2和3所示,您可以创建一个包含所有相关依赖项的pom并引用它,如
How to use POMs as a dependency in Maven? 如何在Maven中将POM用作依赖项?
Let me add two comments: 让我添加两个评论:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.