在多模块项目中构建特定的模块 [英] Build specific module in multi-module project
问题描述
我有一个多模块项目.
我想我只能用以下代码从该多模块项目中编译一个模块:
I thought I can compile only a single module from that multi module project with this line:
mvn -amd -pl "module-name"
这似乎不起作用,而只能构建特定的模块.它的依赖项尚未编译,因此会失败.
This does not seem to work, but only builds the specific module. Its dependencies are not compiled yet so it fails.
有什么办法解决这个问题吗?
Any ideas how to solve that?
推荐答案
改为尝试mvn -am -pl "module-name"
(用-am
替换-amd
).
-amd
标志尝试构建依赖模块名称"的项目,而-am
标志构建模块名称"依赖的项目.我认为这些标志的文档有点违反直觉,但是我很确定这可以解决您的问题.
The -amd
flag tries to build projects that depend upon "module-name" whereas -am
builds projects that "module-name" depends upon. I feel that the documentation on those flags is a little counter-intuitive, but I'm pretty sure that this will fix your problem.
这篇关于在多模块项目中构建特定的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!