行家 - 禁用专用目标的多模块构建模块 [英] maven - disable dedicated goals for modules in multi-module build

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

问题描述

我用一个多模块构建文件来触发一个相当复杂的Java项目的构建。现在,我要创建Eclipse项目文件 - 但不是所有模块。是否有可能定义一个POM,它应的忽略的的日食:日食目标

I use a multi module build file to trigger the build of a rather complex java project. Now I want to create the eclipse project files - but not for all modules. Is it possible to define on a pom, that it shall ignore the eclipse:eclipse goal?

在多模块POM的模块定义,我与 MVN蚀拨打:月食看起来像:

The modules definition of the multi-module pom, that I call with mvn eclipse:eclipse looks like that:

<modules>
  <module>../project1/generate/pom.xml</module>
  <module>../project1/pom.xml</module>
  <module>../project2/generate/pom.xml</module>
  <module>../project2/pom.xml</module>
  <!-- and many more projects with or without generate sub modules -->
</modules>

当然不仅需要创建Eclipse项目,所以我不能只是删除会导致这一目标的麻烦模块聚甲醛。

Of course the pom is not only needed for creating eclipse projects so I can't just remove the modules that cause trouble with that goal.

之所以问:日食:日食上的生成的模块将改变清单文件的某些属性的影响,未来构建执行休息。而且我已经厌倦了纠正这些手动所有的时间;)

The reason for asking: eclipse:eclipse executed on the generate modules will change some attributes in manifest files with the effect that the next build breaks. And I'm tired of correcting them manually all the time ;)

推荐答案

您可以使用的 Maven的先进反应堆选项(因为Maven的2.1):

You can use Maven Advanced Reactor Options (since Maven 2.1):

例如,目标只有PROJECT1和项目2:

For instance, to target only project1 and project2:

mvn --projects project1, project2 eclipse:eclipse

目标PROJECT1及其所有的依赖:

to target project1 and all its dependencies:

mvn --projects project1 --also-make eclipse:eclipse

这为reactoring多mudule项目以标准化的方式,不要求修改的pom.xml

This provides a standardised way for reactoring multi-mudule projects and does not requires modification in pom.xml.

这篇关于行家 - 禁用专用目标的多模块构建模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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