简体   繁体   English

如何在全球范围内管理不同Maven项目之间的依赖关系?

[英]How do to manage Dependencies between different maven projects, globally?

I have X maven project which has dependencies on Y maven project. 我有X Maven项目,它依赖于Y Maven项目。 If I make changes in Y project and build it, how to start X's build also without any manual intervention? 如果我在Y项目中进行更改并进行构建,那么如何在没有任何手动干预的情况下也开始X的构建?

I hope you mind you want to keep your X project up-to-date; 希望您介意保持您的X项目为最新; so when you launch a new build of your Y project then the X project start a new compilation and takes the latest version of Y artifact. 因此,当您启动新的Y项目构建时,X项目将开始新的编译并采用最新版本的Y工件。 If so, the best way is to relay all these operations on a continuous integration strategy. 如果是这样,最好的方法是在持续集成策略中中继所有这些操作。 In your case, for instance, you can set up a new configuration in Jenkins (you can install it in your local tomcat and just deploy the war Jenkins application on it) in which for every time Y project launches a new compilation the X project starts a new build taking the new Y version deployment libraries or whatever it shares in the maven repository. 例如,在您的情况下,您可以在Jenkins中设置新配置(您可以将其安装在本地tomcat中,然后在其上部署war Jenkins应用程序),其中,每次Y项目启动新编译时,X项目就会启动一个采用新的Y版本部署库或它在Maven存储库中共享的库的新版本。 The result is that you will have always the X project aligned with the latest version on Y project. 结果是您将始终使X项目与Y项目上的最新版本保持一致。 Anyway, you must assure you have defined and implemented regression test units either on both projects in order to detect how the new version behaves according to the current project specifications. 无论如何,您必须确保在两个项目中都定义并实现了回归测试单元,以便检测新版本根据当前项目规范的行为。

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

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