简体   繁体   English

一个 Maven 模块是否可能对另一个模块具有无版本依赖性?

[英]Is it possible for one Maven module to have a version-less dependency to another module?

I have multiple Maven modules, let's say A, B, C and I also have a module D .我有多个 Maven 模块,比方说A, B, C ,我还有一个模块D

Can module D have dependencies to A, B, C without explicitly setting their version?模块D是否可以在不显式设置版本的情况下依赖于A, B, C In other words, I'd like module D to be built with the latest code of the other modules.换句话说,我希望模块D是用其他模块的最新代码构建的。

You could just set a minimum version of modules A,B,C in your D module, as per https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402您可以根据https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402在 D 模块中设置模块 A、B、C 的最低版本

like you can set your dependency version as [1.5,) wich means any version greater than or equal to 1.5就像你可以将你的依赖版本设置为 [1.5,) 这意味着任何大于或等于 1.5 的版本

Or you could use "RELEASE" versions, for more information on this please see this other SO question where Rich gives a very good explanation:或者您可以使用“RELEASE”版本,有关这方面的更多信息,请参阅另一个 SO 问题,Rich 给出了很好的解释:

https://stackoverflow.com/a/1172371/14650195 https://stackoverflow.com/a/1172371/14650195

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM