- 徐家辉
- 顾一辉
- 茅悦田
- 原帅
- Java
- Jenkins
- Maven
- Ngrok
- Tomcat
- 项目代码(本文以 springboot 项目为例)
- 配置完成(^_^)
-
设置 .war 打包方式
<packaging>war</packaging>
-
添加 tomcat 依赖
<dependencies> ... <!-- other dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> </dependencies>
-
启动 tomcat
cd /d D:\apache-tomcat-9.0.7\bin startup tomcat
-
jenkins 构建项目后打包成 .war 包,在 build 后执行 Windows batch command
copy C:\Users\DNZ\\.jenkins\workspace\cicdmaven\target\demo-0.0.1-SNAPSHOT.war D:\apache-tomcat-9.0.7\webapps