首页   快速返回

springboot应用打成war包     所属分类 spring
pom packaging 改成 war 


spring-boot-starter-tomcat
javax.servlet-api 
scope 设置为 provider ,打包时排除该依赖




<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>



实现SpringBootServletInitializer,重写configure()方法

mvn clean package

tomcat配置 应用目录或war包路径

server.xml host下




<Context path="/" docBase="/Users/dugang/fun/hellocode/demo/springbootdemowar/target/springbootdemowar-1.0.war"
           reloadable="false"> </Context>
           
 <Context path="/" docBase="/Users/dugang/fun/hellocode/demo/springbootdemowar/target/springbootdemowar-1.0"
           reloadable="false"> </Context>
           


上一篇     下一篇
springboot打包成可执行jar

springboot打包排除配置文件

springboot序列化异常FAIL_ON_EMPTY_BEANS处理

并发编程的挑战摘要

并发机制的底层实现原理摘要

java7 hashmap 要点