开发避坑指南(67):Maven引入iText7-core依赖失败解决方案

异常信息

<dependency>
	<groupId>com.itextpdf</groupId>
	<artifactId>itext7-core</artifactId>
	<version>${itextpdf.version}</version>
</dependency>

在maven中引入itext7-core的上述坐标编译时报错找不到itext-core:

com.itextpdf:itext-core:jar:9.3.0 was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of public has elapsed or updates are forced

异常分析

itext7-core 采用了高度模块化的设计,核心功能与扩展功能分离,开发者可按需引入模块。相比之下,itextpdf (通常指 iText 5) 是一个功能集中的单一 JAR 包。

所以在引入itext7-core的坐标时,坐标的type标签值需修改为pom,而不指定type标签时,默认是jar。

解决办法

坐标增加<type>pom</type>,如下

<dependency>
	<groupId>com.itextpdf</groupId>
	<artifactId>itext7-core</artifactId>
	<version>${itextpdf.version}</version>
	<type>pom</type>
</dependency>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

帧栈

您的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值