How to get maven 3.0 to only build modules with local scm changes

佐手、 提交于 2021-02-18 15:06:35

问题


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

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]

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

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


回答1:


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

svn --non-interactive status

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.



来源:https://stackoverflow.com/questions/7852398/how-to-get-maven-3-0-to-only-build-modules-with-local-scm-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!