Peer not authenticated while importing Gradle project in eclipse
NOTE: Please ensure the server is trustworthy before you follow these steps.
If you get any other error like this:
Could not GET 'https://some_server.com/some/path/some.pom'.
> peer not authenticated
Then you need to import a certificate :
- open the 'https://some_server.com/some/path/some.pom' in your favorite browser
- export the cert using the Steps to export cert from a web site
- copy the cer into
JDK_HOME/jre/lib/security
folder - open a shell and go to
JDK_HOME/jre/lib/security
folder - then import the cer into java using the
keytool -import -alias <the short name of the server> -file <cert_file_name_you_exported.cer> -keystore cacerts -storepass changeit
It will prompt you to import the certificate, type yes and press enter.
Then restart your eclipse and try building the project.
Gradle Could not HEAD https://..pom peer not authenticated
Change your repository syntax to one of the following
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
repositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
Current (2.1) gradle docs claims that
Warning: Be aware that the central Maven 2 repository is HTTP only
and HTTPS is not supported. If you need a public HTTPS enabled
central repository, you can use the JCenter public repository
(see Section 51.6.3, “Maven JCenter repository”).
I think maven central went for https. If I use following syntax.
repositories {
mavenCentral()
}
I get following error.
D:\tools\gradle-2.1-bin\bin\gradle.bat -q
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'XXXX'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve de.undercouch:gradle-download-task:1.0.
Required by:
:XXXX:unspecified
Could not HEAD 'https://repo1.maven.org/maven2/de/undercouch/gradle-download-task/1.0/gradle-download-task-1.0.pom'.
peer not authenticatedTry: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
java 6 - mongodb maven dependency error: peer not authenticated
The connection to https://repo1.maven.org using Java 6 fails because of the Java version you have installed does not support TLS1.2 and repo1.maven.org only supports TLS 1.2 connections.
If you really want to continue using Java 6 you need to install Java SE Development Kit 6, Update 111 or newer.
IMHO you should delete Java 6 (it is outdated and insecure) and install a current Oracle Java version. I assume your version is the one provided by Apple - AFAIK Apple has stopped support for their Java version. Therefore you should no longer use it.
Peer Not Authenticated in maven when trying to run a job in JENKINS
When using SSL to connect to maven repositories you'll need to make sure that the certificates for the repository are trusted by the JVM running maven. Refer to the Guide to Remote repository access through authenticated HTTPS.
Also, as mentioned by rec in an answer to maven release -> peer not authenticated, with newer versions of maven you can disable the certificate validation of the maven http wagon temporarily to confirm if the certificate is indeed the source of the problem:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Related Topics
Limiting Java Ssl Debug Logging
How to Abort a Thread in a Fast and Clean Way in Java
Moving Items Around in an Arraylist
Accessing the Last Entry in a Map
How to Write a Compareto Method Which Compares Objects
How to Get the Generic Type at Runtime
Hibernate:How Override an Attribute from Mapped Super Class
How to Add Shapes on Javafx Linechart
Jvm Option -Xss - What Does It Do Exactly
Could Not Find Method Compile() for Arguments Gradle
Java - Delete Line from Text File by Overwriting While Reading It
Does Java Have a Int.Tryparse That Doesn't Throw an Exception for Bad Data
Change a Method at Runtime via a Hot Swap Mechanism
How to Copy File Inside Jar to Outside the Jar
Stopping a Window from Displaying Till It Is Fully Drawn
Extract String Between Two Strings in Java
How to Serialize a List in Java
Cors Allowed-Origin Restrictions Aren't Causing the Server to Reject Requests