在多模块项目中构建特定的模块 [英] Build specific module in multi-module project

查看:111
本文介绍了在多模块项目中构建特定的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多模块项目.

我想我只能用以下代码从该多模块项目中编译一个模块:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆