maven 打jar包缺失 resources 目录下的 jar 包

部署环境

项目用到docker部署,发布的时候发现后台程序报错。很奇怪在本地能包的项目到服务器上就不能运行,查看报错日志后,发现是找不到自己导入的本地jar包依赖。万番搜索之下,找到只需要加个依赖便可。
下面是我的错误提示和添加的依赖,等下次时间充裕我把我docker打包项目遇到的大坑也记录到博客中。

正文开始

警告 jar should not point at files within the project directory

[WARNING] 'dependencies.dependency.systemPath' for com.yinyuan:radarsdk:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/jar/radar-sdk.jar will be unresolvable by dependent projects @ line 38, column 25

在这里插入图片描述

出错原因:maven 打包时没有将以 systemPath 这种形式引入的 jar 包,包含在内

解决办法:在 spring-boot-maven-plugin 插件中添加如下配置即可

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <includeSystemScope>true</includeSystemScope>
            </configuration>
        </plugin>
    </plugins>
</build>
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值