Last active
March 9, 2018 15:12
-
-
Save frode-carlsen/e4d6f4218994e3797652e57622c88ab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash function to only build modules (and dependent modules) in a multi-module reactor which have been touched since current branch was forked. | |
function mvnd { | |
# NB! ignores changes in pom modules | |
# NB! checks only diffs branch from local master | |
find . -maxdepth 4 -name pom.xml | xargs -I{} grep -iL -F "<packaging>pom</packaging>" {} | xargs dirname |grep -v target | sed -e 's/^.[/]*//g' | grep . > /tmp/mvn-modules.txt && git diff --name-only master | grep -o -F -f /tmp/mvn-modules.txt | xargs | tr ' ' ',' | xargs -I{} mvn $@ -pl {} | |
} | |
function mvndu { | |
# NB! diffs from upstream head (can be used on master branch) | |
find . -maxdepth 4 -name pom.xml | xargs -I{} grep -iL -F "<packaging>pom</packaging>" {} | xargs dirname |grep -v target | sed -e 's/^.[/]*//g' | grep . > /tmp/mvn-modules.txt && git diff --name-only @{u}...HEAD | grep -o -F -f /tmp/mvn-modules.txt | xargs | tr ' ' ',' | xargs -I{} mvn $@ -U -pl {} -amd -pl \!build/ear,\!build/war | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment