带有JDK 8的Maven 3失败并显示[错误]收到致命警报:access_denied

时间:2018-04-17 08:33:52

标签: java maven java-8 maven-3

我的环境:

  • JAVA - 1.8.0_161
  • MAVEN - 3.5.3

在使用Maven 3和Java 8运行简单任务(比如在这里干净)时,我一直面临着问题。

# mvn clean
..
..
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its 
dependencies could not be resolved: Failed to read artifact descriptor for   
org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer 
artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to 
central-no-ssl (https://repo.maven.apache.org/maven2): Received fatal alert: 
access_denied

当我打开调试标志时,我可以发现由于SSL握手而导致的错误,而maven尝试使用HTTPS从REPO下载干净的插件POM

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not 
transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 
from/to central-no-ssl (https://repo.maven.apache.org/maven2): Received 
fatal alert: access_denied
..
..
..
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: 
access_denied
    at sun.security.ssl.Alerts.getSSLException (Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException (Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert (SSLSocketImpl.java:2033)
    at sun.security.ssl.SSLSocketImpl.readRecord (SSLSocketImpl.java:1135)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake 
    (SSLSocketImpl.java:1385)

当我尝试通过在.m2 / settings.xml中更改默认REPO URL到HTTP而不是HTTPS时,问题从SSL的问题变为fortinet防火墙禁止的URL。但是,我可以通过浏览器访问相同的REPO URL。

是否有人面对并修复了MAVEN和JAVA 8的SSL问题?

1 个答案:

答案 0 :(得分:0)

在你的pom.xml中提供java源代码,用于java 1.8 for maven compile plugin并尝试运行mvn clean compile