简体   繁体   English

Maven多模块构建:软件包与安装

[英]maven multimodule build: package vs. install

What is the true way of building multi-module maven project: via package or via install if NONE of the modules will be a dependency for another project? 什么是构建多模块Maven项目的正确的方法:通过package或通过install ,如果模块没有将是另一个项目的依赖? I think in this case package is the only way to build it but I see how people IMO abuse the install goal. 我认为在这种情况下, package是构建它的唯一方法,但是我看到IMO人们如何滥用install目标。 And I don't get why. 我不明白为什么。

Is there any official considerations on how the multi-module project should be built? 关于应如何构建多模块项目,是否有任何官方考虑?

UPD: I have only one explanation. UPD:我只有一个解释。 Sometimes people just unaware of -pl , -am and -rf maven options. 有时人们只是不知道-pl-am-rf maven选项。 Thus it leads them to install the modules' artifacts into repository when they want to build part of the reactor. 因此,这导致他们在想要构建反应堆的一部分时将模块的工件安装到存储库中。

if none of the projects is a dependency of any other project you have a weird setup. 如果没有一个项目是任何其他项目的依赖项,则您的安装程序很奇怪。 why build them together if they don't belong together? 如果它们不属于一起,为什么要一起构建?

Sometimes people just unaware of -pl, -am and -rf maven options 有时人们只是不知道-pl,-am和-rf maven选项

in a normal setup, where there are dependencies between modules, these options (at least -rf ) don't work if the modules aren't installed. 在正常的设置中,模块之间存在依赖关系,如果未安装模块,则这些选项(至少-rf )不起作用。

OK, you are using a dependency management system without dependencies. 好的,您正在使用没有依赖项的依赖项管理系统。 Yes, you can use package instead of install . 是的,您可以使用package而不是install But you are not avoiding bad usage patterns, you are either missing out on features or grouping things together that don't belong together. 但是您并不能避免不良的使用模式,要么错过了功能,要么将不属于一起的事物组合在一起。

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

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