mvn -pl 有什么作用?

发布于 2024-10-10 01:32:47 字数 230 浏览 0 评论 0原文

在此命令期间到底发生了什么:

mvn -pl ABC  –am  -amd?

它会编译代码吗?

我问的原因是我故意放置了一个无效文件,当我运行 mvn -pl ABC -am -amd 选项时,我得到了成功的结果,但我很困惑为什么 Maven 没有抱怨错误的文件?

但是如果我使用 mvn install 命令它会出错!

What exactly happens during this command:

mvn -pl ABC  –am  -amd?

Does it compile the code?

The reason I asked is I have purposely put an invalid file and when I run mvn -pl ABC -am -amd option I get successful result and I'm confused why Maven is not complaining about the errored file?

But if I use mvn install command it errors!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

白馒头 2024-10-17 01:32:47

-pl--projects 允许您选择一组特定的项目来应用您的目标(例如干净安装),这样可以保存如果您只需要构建几个模块,那么您将花费时间等待大型项目的完整构建。

您可能需要检查以下部分:

-pl or --projects allows you to select a specific set of projects to apply your goal, (e.g. clean install) this way saving the time you would spend waiting for a full build on a big project if you just need to build a couple modules.

You might wanna check the following section:

风向决定发型 2024-10-17 01:32:47
  • -pl 使 maven 仅构建指定的模块,而不是整个项目(在本例中它只是 ABC)。
  • -am 使 Maven 找出我们的目标依赖哪些模块并构建它们(在本例中是 ABC 的依赖项)。
  • -pl makes maven build only specified modules and not the whole project (in this case it's only ABC).
  • -am makes maven figure out what modules our target depends on and build them too(in this case it's ABC's dependencies).
ζ澈沫 2024-10-17 01:32:47

如果你说 mvn -pl,并且没有给 -pl 任何参数,那么你就是在要求 maven 什么都不做。

-pl 假设您正处于一个具有多个模块的项目中,并且想要构建一个子集。您刚刚要求空子集。

If you say mvn -pl, and give no argument to -pl, you are asking maven to do absolutely nothing.

-pl assumes that you are sitting in a project with multiple modules, and want to build a subset. You just asked for the null subset.

温折酒 2024-10-17 01:32:47

你实际上并没有给它一个运行的目标。 mvn -pl Abc:Xyz -am -amd 有两个问题。
首先,-amd 隐含 -am,因此您不需要两者。
其次,您没有给它一个运行目标,例如安装、打包、测试或编译。

You haven't actually given it a goal to run. mvn -pl Abc:Xyz -am -amd has two problems with it.
First of all, -amd implies -am, so you don't need both.
Secondly, you haven't given it a goal to run, like install, package, test, or compile.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文