-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
40 lines (31 loc) · 829 Bytes
/
build.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
40
#!/usr/bin/env bash
export JAVA_HOME=/home/work/jdk-1.8
export MAVEN_HOME=/home/work/apache-maven-3.3.3
export PATH=${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}
export NODE_PATH=/home/work/node
export PATH=$NODE_PATH/bin:$PATH
cd `dirname $0`
BUILD_DIR=`pwd`
echo $BUILD_DIR
function check_error()
{
if [ ${?} -ne 0 ]
then
echo "Error! Please Check..."
exit 1
fi
}
PROFILE=online
rm -rf output
mkdir output
if [ $# -ne 0 ]; then
PROFILE=$1
fi
#mvn clean install -P$PROFILE -Dmaven.test.skip=true
if [ $PROFILE = test ]; then
mvn clean compile package -U -P$PROFILE -Dmaven.test.skip=true pmd:pmd findbugs:findbugs checkstyle:checkstyle pmd:cpd
else
mvn clean compile package -U -P$PROFILE -Dmaven.test.skip=true
fi
check_error
mv ./target/bin ./target/lib ./target/conf ./output/