Skip to content

Instantly share code, notes, and snippets.

@ansrivas
Created September 4, 2015 14:43
Show Gist options
  • Save ansrivas/bd36a6bb4c3f72c88241 to your computer and use it in GitHub Desktop.
Save ansrivas/bd36a6bb4c3f72c88241 to your computer and use it in GitHub Desktop.
#a shell script to create an eclipse project, in current directory if 3rd argument isn't passed
#else creates in the current directory
groupID=$1
archetypeArtifactId=$2
directory=$3
if [[ "$1" == "" || "$2" == "" ]] ; then
echo "ERROR !!"
echo "Usagae : bash maven_proj.sh <groupid> <archetypeArtifactId> <absolute-path-directory>(optional)"
exit
fi
if [[ "$3" == "" ]]; then
directory=.
fi
cd $directory
mvn archetype:generate -DgroupId=$groupID -DartifactId=$archetypeArtifactId -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
wait
cd $archetypeArtifactId;
wait
mvn eclipse:eclipse
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment