1.打包模式修改为war包

master
x_z 3 years ago
parent 1eb8e514e8
commit f4e8d6832f

@ -15,7 +15,7 @@
<artifactId>udidl</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
@ -47,6 +47,21 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 移除嵌入式tomcat插件-->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--打包的时候可以不用包进去,别的设施会提供。事实上该依赖理论上可以参与编译,测试,运行等周期。
相当于compile但是打包阶段做了exclude操作-->
<scope>provided</scope>
</dependency>
<!--AOP拦截-->
@ -152,10 +167,19 @@
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>UDI_DL_Server</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -3,16 +3,23 @@ package com.glxp.udidl.admin;
import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@EnableTransactionManagement
@EnableSwagger2WebMvc
@SpringBootApplication(exclude = PageHelperAutoConfiguration.class)
public class Application {
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}

@ -2,7 +2,7 @@ server:
port: 9994
spring:
profiles:
active: dev
active: pro
jmx:
enabled: false

Loading…
Cancel
Save