赞
踩
jar
改成war
<groupId>com.lummer</groupId>
<artifactId>digagr</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>digagr</name> <!-- 这行 -->
<description>Demo project for Spring Boot</description>
tomcat插件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
servlet-api
的依赖(整合jsp文件,可以不添加)<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>8.0.36</version>
<scope>provided</scope>
</dependency>
Application
主类@SpringBootApplication
public class DigagrApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(DigagrApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(DigagrApplication.class, args);
}
}
maven
打包springboot
项目只能在tomcat版本8.5
或以上版本才能成功发布tomcat
请配置好环境变量赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。