springboot labeled jar package and carry third-party jar

1. The modified embodiment is packaged jar

<packaging>jar</packaging>

2. Add a third party to rely pom file

My third-party dependencies in the lib directory under the resources directory (the address can easily write, but the path to the right)
<dependency>
<groupId>otc</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/otc-commons-logging-1.2.jar</systemPath>
</dependency>
3. Modify the plugin
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
If you can not find the resource file can be added (subject to availability)
<-! <Resources> 
<Resource>
<Includes>
. <the include> ** / * the Properties </ the include>
. <the include> ** / * YML </ the include>
. <the include> ** / * xml </ the include>
</ Includes>
</ Resource>
</ Resources> ->

this third party carries springboot end labeled jar package jar package.

Inadequacies also please correct me.

Guess you like

Origin www.cnblogs.com/wlv1314/p/12127878.html
Recommended