forked from color-coding/ibas-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_packages.sh
executable file
·39 lines (37 loc) · 1.68 KB
/
compile_packages.sh
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
38
39
#!/bin/sh
echo '****************************************************************************'
echo ' compile_packages.sh '
echo ' by niuren.zhu '
echo ' 2016.06.17 '
echo ' 说明: '
echo ' 1. 安装apache-maven,sudo apt-get install maven '
echo ' 2. 解压apache-maven,并设置系统变量MAVEN_HOME为解压的程序目录。 '
echo ' 3. 添加PATH变量到MAVEN_HOME\bin,并检查JAVE_HOME配置是否正确。 '
echo ' 4. 运行提示符运行mvn -v 检查安装是否成功。 '
echo ' 5. 编译war包到release目录。 '
echo '****************************************************************************'
# 设置参数变量
WORK_FOLDER=`pwd`
OPNAME=`date '+%Y%m%d_%H%M%S'`
LOGFILE=${WORK_FOLDER}/compile_packages_log_${OPNAME}.txt
echo --当前工作的目录是[${WORK_FOLDER}]
echo --清除项目缓存
if [ -e ${WORK_FOLDER}/release/ ]
then
rm -rf ${WORK_FOLDER}/release/
fi
mkdir -p ${WORK_FOLDER}/release/
echo --开始编译
if [ -e ${WORK_FOLDER}/pom.xml ]
then
mvn clean package -f ${WORK_FOLDER}/pom.xml >>$LOGFILE
if [ -e ${WORK_FOLDER}/target/*.war ]
then
cp -r ${WORK_FOLDER}/target/*.war ${WORK_FOLDER}/release >>$LOGFILE
fi
if [ -d ${WORK_FOLDER}/target ]
then
rm -rf ${WORK_FOLDER}/target >>$LOGFILE
fi
fi
echo --编译完成,更多信息请查看[compile_packages_log_${OPNAME}.txt]