maven引入本地jar,项目打jar包时踩坑

maven引入本地jar不能打入jar部署包的问题解决

1、pom文件引入本地jar

 


       <dependency>
            <groupId>cn.org.bjca</groupId>
            <artifactId>bjcalog</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/BJCA_LOG.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>cn.org.bjca</groupId>
            <artifactId>svsclient</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/SVSClient.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>cn.org.bjca</groupId>
            <artifactId>esspdf</artifactId>
            <version>1.5.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/esspdf-client-1.5.0-SNAPSHOT.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.cloopen</groupId>
            <artifactId>sms</artifactId>
            <version>2.6.3r</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/CCP_REST_SMS_SDK_JAVA_v2.6.3r.jar</systemPath>
        </dependency>

 
在这里插入图片描述
 

2、使用 Maven 打 jar 包

 
在这里插入图片描述
 
打入的jar包没有引入本地的四个jar

 

3、处理方法

 

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!-- 添加以下配置会将本地jar引入最终打的jar包中 -->
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

在这里插入图片描述

最后打 jar 包,成功引入本地的四个 jar !!!

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值