使用Maven执行Java代码

不多说了,直接上代码
Linux环境下,公司名用XXX表示,呵呵


export MAVEN_HOME=/opt/apache-maven-2.2.1 MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=128M"
cd /root/datacenter.script

for i in `ps -efwww|grep com.XXX.dc.crawl.news.sell.SoufunNews|grep -v "grep"|awk '{print $2}'`
do
        kill -9 $i
done
//使用SVN将最新代码 update到liunx服务器
svn update
//使用MVN编译打包 执行java
/opt/apache-maven-2.2.1/bin/mvn clean
/opt/apache-maven-2.2.1/bin/mvn compile
/opt/apache-maven-2.2.1/bin/mvn clean -DskipTests=true install dependency:copy-dependencies  package
/opt/apache-maven-2.2.1/bin/mvn exec:java -Dexec.mainClass="com.XXX.dc.crawl.news.sell.SoufunNews" &> /root/logs/SoufunNews.log

你可能感兴趣的:(java,apache,maven,linux,SVN)