Spring Boot 打包本地 jar 包到 war 包中
Spring Boot Maven Java About 1,170 words本地依赖
本地jar
包放置与resource
文件夹下的lib
文件夹。
<dependency>
<groupId>com.example.utils</groupId>
<artifactId>example-utils</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/example-utils-1.0.0-2020408_RELEASE.jar</systemPath>
</dependency>
war包插件
添加webResources
节点。directory
标签内配置本地jar
位置,targetPath
标签内配置最后打包到war
包后jar
包存放的位置。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warName>test-war</warName>
<webResources>
<resource>
<directory>${project.basedir}/src/main/resources/lib/</directory>
<targetPath>WEB-INF/lib</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
Views: 2,141 · Posted: 2020-04-08
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...