2019独角兽企业重金招聘Python工程师标准>>>
1 调用maven 命令打包
mvn -B -f D:/workspace/ksdcourse clean package
2 调用tomcat 部署war包 ; 需要添加 CATALINA_HOME的环境变量
代码如下:
#!/usr/bin/python3# -*- coding: utf-8 -*-import os,shutilos.system('mvn -B -f D:/workspace/ttcourse clean package') shutil.copy("D:/workspace/ttcourse/target/ROOT.war", "D:/tools/apache-tomcat-8.5.8/webapps")os.system('D:/tools/apache-tomcat-8.5.8/bin/shutdown.bat') os.system('D:/tools/apache-tomcat-8.5.8/bin/startup.bat')