码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot不通过私服方式引入第三方jar包

时间:2019-03-18 19:51:58      阅读:453      评论:0      收藏:0      [点我收藏+]

标签:pom.xml   include   路径   目录   color   增加   maven   path   temp   

SpringBoot不通过私服方式引入第三方jar包

技术图片

比如打包的时候想引入lib文件夹下的第三方jar包,

pom.xml配置如下:

<dependencies>标签里面引入第三方jar包的依赖
pom.basedir指的是pom文件所在的目录,
systemPath指的是第三方jar包所在路径。
<dependency>
        <groupId>com.abc</groupId>
        <artifactId>cryptokit</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>${pom.basedir}/lib/cryptokit-1.0.jar</systemPath>
 </dependency>

还必须修改<plugins>标签里面的maven plugin,增加includeSystemScope属性并设置为true

<plugin>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-maven-plugin</artifactId>
     <configuration>
           <includeSystemScope>true</includeSystemScope>
      </configuration>
</plugin>

通过以上的方式,就能使用maven将springboot项目打成一个jar包的时候引入第三方jar了,比弄私服,本地仓库省事、方便

 

SpringBoot不通过私服方式引入第三方jar包

标签:pom.xml   include   路径   目录   color   增加   maven   path   temp   

原文地址:https://www.cnblogs.com/stm32stm32/p/10554333.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!