最近想引入自己的jar包 在resources下建了一个目录 本地运行没有问题 打包打不进去:
pom.xml
1 2 3 4 5 6 7 | <dependency> <groupId>com.dm</groupId> <artifactId>xxx</artifactId> <version>1.xx</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/lib/xxx.jar</systemPath> </dependency><br><br> |
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<!--指定引入外部包的位置 mvn package -Dmaven.test.skip=true-->
<!--打包部署放开以下注释-->
<!--正常启动需注释以下代码,否则会包shiro错误-->
<resources>
<resource>
<directory>${project.basedir}/src/main/resources/lib</directory>
<targetPath>/BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<targetPath>BOOT-INF/classes/</targetPath>
</resource>
</resources>
参考链接2:
https://blog.csdn.net/weixin_42476367/article/details/123085691
本文来自博客园,作者:哈利波特甜,转载请注明原文链接:https://www.cnblogs.com/zmh-980509/p/16276236.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构