Created
September 7, 2012 01:50
-
-
Save omnisis/3662506 to your computer and use it in GitHub Desktop.
Maven Bash Function to run archetype generate using "gradle/grails style" GAV descriptors
This file contains hidden or 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
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256M" | |
function maven-new-proj() { | |
if [ ! $# -eq 2 ]; then | |
echo "Usage: maven-new-proj example.org:some-archetype:1.0 mygroupid.myartifact" | |
fi | |
OIFS=$IFS | |
IFS=':' | |
read -rA ARCH_GAV <<< "$1" | |
read -rA PROJ_GAV <<< "$2" | |
IFS=$OIFS | |
cmd="mvn archetype:generate -DarchetypeGroupId=${ARCH_GAV[1]} \ | |
-DarchetypeArtifactId=${ARCH_GAV[2]} \ | |
-DarchetypeVersion=${ARCH_GAV[3]} \ | |
-DgroupId=${PROJ_GAV[1]} \ | |
-DartifactId=${PROJ_GAV[2]}" | |
sh -c "$cmd" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment