简体   繁体   English

构建多模块Maven项目

[英]Building multimodule maven project

Hi I've searched the net, read a bunch of articles, so questions and documentation but I can not find solution, here is my problem. 嗨,我已经在网上搜索过,读了很多文章,所以有问题和文档,但找不到解决方案,这是我的问题。

I have a multimodule maven project which contains three modules A,B and C. A and B independent and C is depend on A and B, and of course I have a parent project. 我有一个包含三个模块A,B和C的多模块Maven项目。A和B独立且C取决于A和B,当然我有一个父项目。 I also have a jenkins server set up to build these projects, and a nexus repository. 我还设置了一个jenkins服务器来构建这些项目以及一个nexus存储库。

My problem is that when I build the project the maven builds A and B correctly but for C it downloads an older artifact from the nexus repository and of course it fails to build module C. How can I make the maven to use the currently built jars which installed into the local repository instead of the older ones on nexus? 我的问题是,当我构建项目时,maven正确地构建了A和B,但对于C,它从nexus存储库中下载了一个较旧的工件,当然它无法构建模块C。如何使Maven使用当前构建的jars哪个安装在本地存储库中,而不是nexus上的旧版本?

Version of A and B and C set to 1.1.{build_number}-SNAPSHOT with maven version plugin, and as I understand maven should use the newer from local but it does not do it. A和B和C的版本设置为1.1。{build_number} -SNAPSHOT具有maven版本插件,据我了解,maven应该使用本地的较新版本,但它不这样做。 Initially I do not want to post hundreds of lines of pom.xmls but if you need section I will provide it. 最初,我不想发布数百行pom.xmls,但是如果需要的话,我会提供。

Any help would be appreciated. 任何帮助,将不胜感激。 Thank You! 谢谢!

I have been setting the version numbers in the submodule's poms and changed to inherit version number from parent pom. 我一直在子模块的poms中设置版本号,并更改为从父pom继承版本号。 In module C 's pom module A and B versions set to ${project.version} 在模块C的pom模块AB版本设置为${project.version}

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

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