Could not transfer artifact (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]

后端 未结 9 763
栀梦
栀梦 2020-12-13 18:09

I am new to Maven and trying to setup my first project in Maven but receiving the below error message when I am doing \" Run as -> Maven install \" in Eclipse. Below is my s

相关标签:
9条回答
  • 2020-12-13 18:24

    The Package you are trying to install doesn't support TLS1.1 and you might be by default using TLS 1.1. Configure your Java runtime to enable TLS 1.2 by adding -Dhttps.protocols=TLSv1.2 to your Maven Build command would solve the problem.

    For Example: mvn clean install -Dhttps.protocols=TLSv1.2

    0 讨论(0)
  • 2020-12-13 18:27

    For a permanent solution(mostly required in Java 7) - in you build directory(where you do the mvn command from) add directory:

    .mvn (in cmd mkdir .mvn)

    and in it create file

    jvm.config

    and in put the following line:

    -Dhttps.protocols=TLSv1.2

    0 讨论(0)
  • 2020-12-13 18:29

    The simplest solution is to configure your JVM runtime arguments. On eclipse, you can do it as following :

    go to windows>preferences>java>installed JREs click on the Intalled JRE/JDK you are using for your project

    click on "edit" on le right, and add -Dhttps.protocols=TLSv1.2 in the Default VM arguments Input field.

    see the screenshot :

    Screenshot

    0 讨论(0)
  • 2020-12-13 18:39

    I set my settings.xml file in the .m2 directory just as the one here: https://github.com/alipay/sofa-rpc/pull/190/files

    Then exec mvn install and all dependencies started to download. I haven't had a settings.xml file before and I am not using any proxy. Hope it helps somebody.

    PD. I have jdk 1.7 and Maven 3.3.9

    0 讨论(0)
  • 2020-12-13 18:40

    Sonatype no longer supports TLSv1.1 and below (effective, June 18th, 2018). My guess is that you are using TLSv1.1 protocol or below.

    The documentation I listed gives you 4 options:

    1. Upgrade your Java runtime, for example with OpenJDK builds or Oracle paying support
    2. Configure your Java runtime to enable TLS 1.2 by adding -Dhttps.protocols=TLSv1.2
    3. Use a repository manager that uses a Java version supporting TLS 1.2
    4. Revert back to http until you can acheive one of the above remediation steps.

    I fixed it myself by just using -Dhttps.protocols=TLSv1.2 as a VM argument.  

    0 讨论(0)
  • 2020-12-13 18:40

    It needs both : Configuring the JVM runtime arguments as well as having a settings.xml, after I did both it worked. Updating only the JVM runtime argument did not help.

    0 讨论(0)
提交回复
热议问题