You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行OpenRewrite预演遇PKIX路径验证失败问题求助

解决maven.java.net仓库证书过期导致的SSL握手失败问题

问题根源

从错误日志可明确:maven.java.net仓库的SSL证书已于2024年3月20日过期,触发PKIX路径验证失败。这个问题和你降级Maven版本无关——无论用3.9.5还是3.6.3,证书过期都会导致握手失败。

另外,OpenRewrite的Maven插件不会自带独立Maven版本,它会复用当前环境配置的Maven(比如PATH中的或IDE指定的),所以降级Maven版本无法解决该问题。

解决方案

maven.java.net相关仓库已停止维护,建议直接替换为Maven Central或其他可靠镜像仓库:

  1. 修改项目pom.xml
    找到仓库配置段,将原maven.java.net仓库替换为Maven Central:
<repositories>
    <repository>
        <id>central</id>
        <url>https://repo1.maven.org/maven2/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <url>https://repo1.maven.org/maven2/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>
  1. 修改全局Maven settings.xml
    若为全局配置问题,找到~/.m2/settings.xml(Windows路径:C:\Users\<你的用户名>\.m2\settings.xml),更新镜像配置:
<mirrors>
    <mirror>
        <id>central</id>
        <mirrorOf>central</mirrorOf>
        <url>https://repo1.maven.org/maven2/</url>
    </mirror>
    <!-- 删除或替换原maven.java.net相关镜像配置 -->
</mirrors>
  1. 清理本地Maven缓存
    执行命令清理过期缓存,避免残留问题:
mvn clean install -U

额外说明

如果项目依赖仅能从maven.java.net获取(这种情况极少),可手动导入依赖到本地仓库,但更推荐迁移至维护中的仓库,避免后续再出现类似问题。

内容的提问来源于stack exchange,提问作者Hernando Quevedo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 22:42:30