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

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.  


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


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

Tags:

Java

Maven