【Maven安装paperhelper插件报错】

  • 首先是在写<dependency>标签的时候没有自动补全,所以全部手动敲入:
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.4.6</version>
        </dependency>
  • 用的jdk 17,在paperhelper版本号(1.4.6/2.0.0)上犹豫,并重构了几次,均报错,最终的报错如下(这里可能有各种原因,包括我也一直在重启):
com.fasterxml.jackson:jackson-parent:pom:2.13 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.fasterxml.jackson:jackson-parent:pom:2.13 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.108.215] failed: Read timed out

总结在成功前有以下几项关键操作:

(1)解决网络不稳定问题,配置源:E:\Tools\apache-maven-3.9.0\conf\settings.xml

<mirror>
    <id>aliyun</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun</name>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>

(2)手动删除了这些目录下已安装好的paperhelper的各版本(注意看目录下的同衍生包):'C:\Users\<你的用户名>\.m2\repository\com\github\pagehelper'
(3)在项目的终端里强制更新Maven依赖

mvn clean install -U

(4)重建项目

  • 在顶部菜单中,选择 构建(Build)。
  • 选择 重建项目(Rebuild Project)。

(5)检查导入

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

:以上是解决报错的可能性有效操作,不太明白原理,欢迎交流指导

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值