java network_error ai_generated true

无法从/向中央仓库 (https://repo.maven.apache.org/maven2) 传输工件 com.example:lib:1.0.0:收到致命警报:证书未知。位于 https://internal-mirror.com/maven2 的仓库镜像可能配置错误。

Could not transfer artifact com.example:lib:1.0.0 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: certificate_unknown. The repository mirror at https://internal-mirror.com/maven2 may be misconfigured.

ID: java/maven-repository-mirror-loop

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2026-01-15首次发现

版本兼容性

版本状态引入弃用备注
8+ active — — —

根因分析

镜像仓库的 SSL 证书不被 Java 运行时信任,或镜像配置错误。

English

The SSL certificate of the mirror repository is not trusted by the Java runtime, or the mirror is misconfigured.

generic

解决方案

  1. 95% 成功率 Import the mirror's SSL certificate into the Java truststore
    keytool -import -alias mirror -keystore $JAVA_HOME/lib/security/cacerts -file mirror.crt
  2. 90% 成功率 Use HTTPS with a trusted certificate or switch to HTTP if allowed
    <mirror><id>internal</id><url>http://internal-mirror.com/maven2</url><mirrorOf>central</mirrorOf></mirror>

无效尝试

常见但无效的做法:

  1. Disabling SSL verification globally in settings.xml 80% 失败

    This is a security risk and may not be allowed in corporate environments.

  2. Using a different mirror without verifying its certificate 90% 失败

    The new mirror may have the same issue or be malicious.