美文网首页
springboot项目导出war包

springboot项目导出war包

作者: 告诉自己活是干不完的 | 来源:发表于2019-05-23 20:54 被阅读0次

    1.在pom.xml里修改或者添加packaging,值为war

    2.在pom.xml里添加依赖

    <dependency>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-starter-tomcat</artifactId>

    <scope>compile</scope>

    </dependency>

    3.修改工程的启动类

    @SpringBootApplication

    public class ParserinterfaceApplicationextends SpringBootServletInitializer

            implements WebApplicationInitializer{

            @Override

              protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {

                    return application.sources(ParserinterfaceApplication.class);

            }

            public static void main(String[] args) {

                    SpringApplication.run(ParserinterfaceApplication.class, args);

            }

    }

    相关文章

      网友评论

          本文标题:springboot项目导出war包

          本文链接:https://www.haomeiwen.com/subject/pzhizqtx.html