-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-spring5-project.sh
More file actions
executable file
·39 lines (30 loc) · 1.02 KB
/
make-spring5-project.sh
File metadata and controls
executable file
·39 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
if [ -f "set-env.properties" ]; then
source set-env.properties
else
echo "set-env.properties file does not exist, loading default settings."
source set-env-default.properties
fi
GROUP_ID=org.fp024.sample
ARTIFACT_ID=spring5-mvc-sample
PACKAGE=org.fp024.sample
echo ### Create ${ARTIFACT_ID} Project ###
# 환경변수 설정
export JAVA_HOME=${JAVA_8_HOME}
export MAVEN_HOME=${MAVEN_HOME}
REPO_ROOT_DIR=$(dirname "$(realpath "$0")")
# ARTIFACT_ID에 해당하는 디렉토리가 존재하는지 확인하고 삭제
if [ -d "${REPO_ROOT_DIR}/${ARTIFACT_ID}" ]; then
echo "Deleting directory: ${REPO_ROOT_DIR}/${ARTIFACT_ID}"
rm -rf "${REPO_ROOT_DIR}/${ARTIFACT_ID}"
fi
${MAVEN_HOME}/bin/mvn archetype:generate \
-DarchetypeGroupId=org.fp024.archetype \
-DarchetypeArtifactId=spring5-mvc-project-archetype \
-DarchetypeVersion=1.0.0-SNAPSHOT \
-DgroupId=${GROUP_ID} \
-DartifactId=${ARTIFACT_ID} \
-Dpackage=${PACKAGE}
echo "${ARTIFACT_ID} Project is created."
echo "Press any key to continue..."
read -n 1