springboot war包匯出
阿新 • • 發佈:2019-01-02
- 由jar變成war
<packaging>war</packaging>
web依賴去除tomcat
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId
新增SpringBootStartApplication
- 其中Demo1Application.class為原@SpringBootApplication啟動類
package com.trs.stratup; import
- 其中Demo1Application.class為原@SpringBootApplication啟動類
因為有本地依賴的檔案所以將依賴路徑加入pom.xml
- lib在pom同級路徑下
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> <compilerArguments> <extdirs>lib</extdirs> </compilerArguments> </configuration> </plugin>
- lib在pom同級路徑下
- 使用mvn clean package打包