Maven Errror Could not transfer artifact org.apache.maven.plugins:maven-source-plugin:pom:3.0.1 from/to central
According to the error message:
Transfer failed for https://repo.maven.apache.org/maven2...unable to find valid certification path to requested target
It shows the Maven is trying to download an indirect dependency from Maven Central Repository located at https://repo.maven.apache.org/maven
2, which is a secured HTTP server (HTTPS). So the issue may comes from your certificate itself or your network.
For the certificate, try to https://repo.maven.apache.org/maven2
and downloaded the certificate, then added it to the cacerts, with the command:
keytool -import -alias example -keystore .\cacerts -file example.cer
Please try to check more info from this thread "PKIX path building failed" and "unable to find valid certification path to requested target"
For the network, please try to access that very URL on you browser and check if it's operational. If you really can't access the Maven Central Repo with HTTPS from your browser, maybe it's becouse you are behind some proxy rule that is keeping you from download the server certificate.
You could set the settings.xml file is like below:
<proxies>
<proxy>
<active>true</active>
<protocol>https</protocol>
<host>MY_COMPANY_HOST</host>
<port>8080</port>
<username>MY_USERNAME</username>
<password>MY_PASSWORD</password>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>MY_COMPANY_HOST</host>
<port>8080</port>
<username>MY_USERNAME</username>
<password>MY_PASSWORD</password>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
</proxies>
And check the thread Problems using Maven and SSL behind proxy for some more details.
Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud
I tried the same pom.xml inEclipse IDE and surprisingly it worked there as it is.
To make it work on STS, I added following properties
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<start-class>io.pivotal.microservices.services.Main</start-class>
<spring-cloud.version>Brixton.RELEASE</spring-cloud.version>
</properties>
Refer Unable to download/import package org.springframework.cloud.config.server.EnableConfigServer
This worked for me, though I am still curious about the difference.
Spring-Boot-Maven-Plugin issue "could not transfer"
Sound like you don't have a proxy in your settings.xml. Take a look here for details on how to set it up.
<proxies>
<proxy>
<id>example-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
</proxy>
</proxies>
You should be able to take the proxy details from your browser settings.
Related Topics
How to Write a User Input Based Constructor
Java:Using Apache Poi How to Convert Ms Word File to Pdf
Duplicate Entry Exception: Spring Hibernate/Jpa Cascade Save Many to One
Java Execution Pops a New Window and Immediately Disappears
Open Pdf from Bytes Array in Angular 5
Utf-8 Encoding of Application.Properties Attributes in Spring-Boot
Selecting from Div Class Dropdown - Selenium
How to Change Read-Only Status of Files in Intellij
How to Get Values of All Elements from Xml String in Java
What Is the Most Elegant Way to Check If All Values in a Boolean Array Are True
Wait Until All Threads Finish Their Work in Java
Set Current Timezone to @Jsonformat Timezone Value
How to Valid @Requestheader in Spring Boot
Update Objects in One List Based on Values from Second One Using Streams
Find Difference Between Two Strings
How to Handle Incorrect User Input into a Scanner
Fixing Apache V9.0 Server Tomcat V9.0 Server At Localhost Failed to Start Error