Skip to content

gary-feng/mn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run project

mvn spring-boot:run

mvnw spring-boot:run

Package project

mvn package

Deploy war package to tomcat

  1. Change package type
<packaging>war</packaging>

2.SpringBoot embed tomcat, need exclude tomcat from spring-boot-starter-web. But we still need tomcat for local test.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <!-- Exclude embedded tomcat for run project in tomcat -->
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
    </exclusions>
</dependency>

3.Add new subclass of SpringBootServletInitializer and overwrite it's configure method.

package com.mn.servlet;

public class ServletInitializer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(MeinvApplication.class);
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published