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
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
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 :
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
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:
I fixed it myself by just using -Dhttps.protocols=TLSv1.2 as a VM argument.
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.