shell腳本(可用於項目編譯平台,支持眾多項目的個性化編譯):
if [ x$1 == x ]; then
echo default jdk1.6
exit 0
fi
if [ x$1 == x1.7 ]; then
echo change jdk to 1.7
export JAVA_HOME=/source/jdk/jdk1.7.0_79
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
java -version
cd $2
mvn clean
mvn compile
mvn package
fi
if [ x$1 == x1.8 ]; then
echo change jdk to 1.8
export JAVA_HOME=/source/jdk/jdk1.8.0_121
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
java -version
cd $2
mvn clean
mvn compile
mvn package
fi
執行腳本命令:/source/onlinecompile.sh 1.7 /source/code/cluster/ >> /source/11.log