Last active
August 29, 2015 13:59
-
-
Save webee/10979295 to your computer and use it in GitHub Desktop.
generate a maven jar project from test-maven-project.
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
| #!/bin/bash | |
| name=$1 | |
| username=webee | |
| template=test-maven-project | |
| function LOG_INFO() { | |
| local msg=$1 | |
| echo "[$(date +'%Y-%m-%d %H:%M:%S.%N')][INFO] ${msg}" | |
| } | |
| git clone [email protected]:webee/${template}.git ${name} | |
| cd ${name} | |
| LOG_INFO "remove git repo" | |
| rm -rf .git | |
| LOG_INFO "modify <artifactId>" | |
| sed "s/<artifactId>${template}<\/artifactId>/<artifactId>${name}<\/artifactId>/" pom.xml >.pom.xml | |
| mv .pom.xml pom.xml | |
| LOG_INFO "modify <name>" | |
| sed "s/<name>${template}<\/name>/<name>${name}<\/name>/" pom.xml >.pom.xml | |
| mv .pom.xml pom.xml | |
| LOG_INFO "modify <repositoryName>" | |
| sed "s/<repositoryName>${template}<\/repositoryName>/<repositoryName>${name}<\/repositoryName>/" pom.xml >.pom.xml | |
| mv .pom.xml pom.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment