Skip to content

Instantly share code, notes, and snippets.

@IvoLimmen
Last active March 11, 2024 09:14
Show Gist options
  • Save IvoLimmen/c5b91de2b341fd00f075e5abd12b3e82 to your computer and use it in GitHub Desktop.
Save IvoLimmen/c5b91de2b341fd00f075e5abd12b3e82 to your computer and use it in GitHub Desktop.
Just build what is needed
#!/bin/bash
ARGS="$@"
set ARTIFACT=
for f in $(git status -s | cut -c 4- | cut -d/ -f1 - | sort -u)
do
if [ -d ${f} ] # must be a directory
then
if [ "${ARTIFACT}" == "" ]
then
ARTIFACT="${f}"
else
ARTIFACT="${ARTIFACT},${f}"
fi
fi
done
echo "Changes in: ${ARTIFACT}"
echo "Running: mvn ${ARGS} -pl ${ARTIFACT}"
mvn ${ARGS} -pl ${ARTIFACT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment