惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
The Last Watchdog
The Last Watchdog
T
Tenable Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
V
Vulnerabilities – Threatpost
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
A
Arctic Wolf
云风的 BLOG
云风的 BLOG
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
Spread Privacy
Spread Privacy
S
Schneier on Security
Project Zero
Project Zero
L
LINUX DO - 热门话题
M
MIT News - Artificial intelligence
F
Full Disclosure
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
Cyberwarzone
Cyberwarzone
AWS News Blog
AWS News Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tailwind CSS Blog
K
Kaspersky official blog
Recent Announcements
Recent Announcements
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
P
Privacy & Cybersecurity Law Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Exploit Database - CXSecurity.com
V
Visual Studio Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Webroot Blog
Webroot Blog

Deed's博客

解决群晖百度套件提示name "baiduapp" dupliacted - Deed's博客 2022年8月23日nginx反向代理配置去除前缀 - Deed's博客 2022年8月1日 ts-node 运行报错`Cannot find name 'console'.` 2022年7月13日 Gradle项目打包相关配置 - Deed's博客 2022年6月23日 Windows 杀死进程 - Deed's博客 2022年6月16日 查看服务器异常IP访问以及处理 - Deed's博客 2022年6月15日 Linux删除用户 - Deed's博客 2022年6月8日 AntDesignPro文档Demo示例[后置拦截器]报错 - Deed's博客 2022年6月8日 React使用umi.js报错Invalid hook call - Deed's博客
2023年3月16日 Maven项目引入第三方本地jar包 - Deed's博客
Mahalalel · 2023-03-16 · via Deed's博客
«

Mahalalel 发布于 阅读:6253 Maven


一、背景

项目需要引入第三方公司封装的私有jar包,jar包没有在公共仓库中
只能复制到项目resources文件夹下

idea中通过Project Structure 方法引入jar包所在文件夹,每次用Maven clean命令就会出现问题
需要手动把jar包重新导入下

二、解决方案

在项目的pom文件中配置Maven依赖坐标,即可不用重复以上操作
具体依赖坐标代码如下:

<dependency>
    <groupId>xxx</groupId>
    <artifactId>xxx</artifactId>
    <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/lib/xxx.jar</systemPath>
</dependency>

注:groupIdartifactId设置为jar包的名称即可,version版本号需要看第三方jar有没有版本号,没有就自由定义。

Maven引入 第三方jar包