模块之间关系如下图所示
image.pngA: pom
中设置<packaging>pom</packaging>
B: pom
中设置<packaging>jar</packaging>
C: pom
中设置<packaging>war</packaging>
<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>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<build>
<finalName>xxxx</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
启动类中
@SpringBootApplication
public class MgrSite extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(MgrSite.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(MgrSite.class);
}
}
D: 配置和C一样
网友评论