Skip to content

Instantly share code, notes, and snippets.

@webee
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save webee/10979295 to your computer and use it in GitHub Desktop.

Select an option

Save webee/10979295 to your computer and use it in GitHub Desktop.
generate a maven jar project from test-maven-project.
#!/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