如何让 maven 3.0 只构建具有本地 scm 更改的模块 [英] How to get maven 3.0 to only build modules with local scm changes

查看:50
本文介绍了如何让 maven 3.0 只构建具有本地 scm 更改的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 maven 2.x 中,您可以使用 reactor:make-scm-changes 仅构建具有本地 scm 更改的模块.

In maven 2.x you could use the reactor:make-scm-changes to build only modules with local scm changes.

使用 maven 3.0.3 运行此模块会导致失败

Running this module with maven 3.0.3 results in a failure

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-reactor-plugin:1.0
:make-scm-changes (default-cli) on project my-project: The parameters 'artifactLis
t', 'folderList' for goal org.apache.maven.plugins:maven-reactor-plugin:1.0:make
-scm-changes are missing or invalid -> [Help 1]

这篇文章似乎表明 maven 3.0 没有等效的功能http://mail-archives.apache.org/mod_mbox/maven-dev/201011.mbox/%3calpine.OSX.2.00.1011051125410.368@dfab-2.local%3e

This post seems to indicate there is no equivalent functionality for maven 3.0 http://mail-archives.apache.org/mod_mbox/maven-dev/201011.mbox/%3calpine.OSX.2.00.1011051125410.368@dfab-2.local%3e

maven 3.0 中是否有替代品以获得仅构建具有本地 scm 更改的模块的功能?

Is there a replacement in maven 3.0 to get the functionality to only build modules that have local scm changes?

推荐答案

您可以使用以以下方式为中心的 shell 脚本推出自己的方案:

You could roll your own with a shell script that centers around:

svn --non-interactive status

您的 shell 脚本可以执行以下操作:

Your shell script could do something like so:

PROJECT_LIST=`svn --non-interactive status | filter out target dir \
                                           | cut out status \
                                           | cut out subdirectories \
                                           | replace line endings with ','`
mvn $* --projects=$PROJECT_LIST

我没有测试过,但我知道理论上可行.

I didn't test it out, but I know it's possible in theory.

这篇关于如何让 maven 3.0 只构建具有本地 scm 更改的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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