1.打包模式修改为war包

master
x_z 3 years ago
parent 1eb8e514e8
commit f4e8d6832f

@ -15,7 +15,7 @@
<artifactId>udidl</artifactId> <artifactId>udidl</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>war</packaging>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
@ -47,6 +47,21 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <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> </dependency>
<!--AOP拦截--> <!--AOP拦截-->
@ -152,10 +167,19 @@
<version>5.5.1</version> <version>5.5.1</version>
</dependency> </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>UDI_DL_Server</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

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

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

Loading…
Cancel
Save