My experience is almost exactly like the one who posted here Certification path error when creating Maven project in Eclipse except I haven't been able to fix my problem
I created a blank maven simple web project (in both eclipse and in vscode) but in my pom.xml at the parent tag, I get the following error.
Project build error: Non-resolvable parent POM for
com.group:demo:0.0.1-SNAPSHOT:
org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 failed
to transfer from
https://nexus.company.com/repository/maven-central-proxy/ during a
previous attempt. This failure was cached in the local repository and
resolution is not reattempted until the update interval of
e-maven-central-mirror has elapsed or updates are forced. Original
error: Could not transfer artifact
org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 from/to
e-maven-central-mirror
(https://nexus.company.com/repository/maven-central-proxy/): PKIX path
building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target and
'parent.relativePath' points at no local POM
In my settings.xml, I have my proxies, servers and mirrors tags set with the necessary information. (By my company's setup guide, this is all I should have but even with the proxy tags added, the non-resolvable parent POM error message stays)
<settings>
<servers>
<server>
<id>e-maven-central-mirror</id>
<username>username</username>
<password>tokenpassword</password>
</server>
</servers>
<mirrors>
<mirror>
<!-- Comments about what are happening here -->
<id>e-maven-central-mirror</id>
<mirrorOf>*</mirrorOf>
<url>https://nexus.company.com/repository/maven-central-proxy/</url>
</mirror>
</mirrors>
</settings>
I'm able to access the url with my id and my token password as normal. I've also gone through the trouble of adding the https://nexus.company.com/repository/maven-central-proxy certificate to both my %JAVA_HOME% (Jdk11) and %JRELOC% (Jre8) cacerts using the keytool. (I added to both as I wasn't sure which Java was the one being used)
I have spent a couple days on this and I'm not sure what it is that I'm doing wrong. Any clarification would be greatly appreciated. Thanks
Edit: I have my env variables HTTP_PROXY and HTTPS_PROXY set. Also saw that my nexus certificates were added to my JDK's keystore but not in the JRE's keystore if that's any useful informtation.
Related
I am importing spring boot project after generating the zip file from spring.start.io -
spring.start.io
Complete project is not getting imported .It is giving errors in pom.xml like
Failure to transfer com.fasterxml.jackson:jackson-bom:pom:2.10.4 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.fasterxml.jackson:jackson-bom:pom:2.10.4 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer http://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.10.4/jackson-bom-2.10.4.pom. Error code 501, HTTPS Required
It is imported as-
How it is imported
Where is the problem?
Could you try to add -U as argument of your mvn command to force the update of depedencies cached in your repository ? ex :
mvn -U clean install
You also have a warning about https that is required by maven central so set https in sour maven settings.xml
like :
<settings>
<mirrors>
<mirror>
<id>internal-repository</id>
<name>Maven Repository Manager running on https://repo1.maven.org/maven2</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
You also have an error about https as http is no longer supported on maven repository. You have to set http://insecure.repo1.maven.org/maven2/ if you really have no choice to use insecure http. It's well documented :
https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required
Best regards.
I'm trying to set up a Maven project with NetBeans on a machine behind a proxy.
When I try to build the dependencies, I get the following error:
Plugin org.apache.maven.plugins:maven-dependency-plugin:2.6 or one of
its dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-dependency-plugin:jar:2.6: Could not
transfer artifact
org.apache.maven.plugins:maven-dependency-plugin:pom:2.6 from/to
central (https://repo.maven.apache.org/maven2):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target -> [Help 1]
As stated here, it's probably because of my proxy configuration.
Netbeans itself has access to the internet. Loading plugins etc. works:
A possible solution would be setting the proxy settings in settings.xml:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>user</username>
<password>****</password>
<host>proxy</host>
<port>8080</port>
</proxy>
However, as the proxy configuration is set globaly, I don't have access to the parameters (user, password, etc.).
Is there any way, to get Maven to using the global proxy, as NetBeans already does, without asking the admin?
In our organization we use internal Artifactory server as maven repository. I have setup the Maven settings accordingly. Problem is when I do Maven > Update from Eclipse below error is thrown -
Failure to transfer
org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from
https://.../artifactory/public was cached in
the local repository, resolution will not be reattempted until the
update interval of artifactory has elapsed or updates are forced.
Original error: Could not transfer artifact
org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to
artifactory (https://.../artifactory/public):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
This is what I have tried so far -
Imported the Artifactory server certificate manually using keytool in Java cacerts.
Ensured that Eclipse setting is pointing to respective Maven and JDK installations.
Deleted m2_repo and rebuilt
Deleted eclipse setup and setup afresh
Restarted system
When I run Maven from command prompt it works fine. What am I missing here?
Issue got resolved when I tried Maven > Update with Force Update of Snapshot/Releases enabled.
Im am trying to Maven install and create the jar for my project . but i am getting the following error:
Plugin org.apache.maven.plugins:maven-surefire-plugin:2.19.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.19.1: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.19.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: unknown error: Unknown host repo.maven.apache.org: unknown error -> [Help 1]
Any help appreciated. I have found similar threads but none of them worked. Added the missing plugin like below but still the same issue. Any help is appreciated.
Plug in added:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
</plugin>
</plugins>
Thanks in Advance.
As khmarbaise and lexicore have already mentioned you need to configure your proxy for maven. Please confirm that you are on your company's network. If so:
Find out your proxy
If your using your company's laptop your browser is probably already configured to use the company proxy. This is a good wikihow article for looking up your proxy settings in different browsers. You want to take not of:
Proxy Server Host Name
Proxy Server Port
Proxy Server Username (if there is one)
Proxy Server Password (if there is one)
If the proxy hasn't been configured in your browser by normal methods, you should get in touch with your IT department and ask them for the proxy server details.
Configuring your proxy for maven
Once you have your proxy server settings. Open your ~/.m2/settings.xml file. If it doesn't exist create it. Now fill in the details of your proxy server with the following format:
<settings>
<proxies>
<proxy>
<id>work-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>my.proxy.host.name</host>
<port>proxyport</port>
<username>proxyuser</username> <!-- Remove this option if there is no user name -->
<password>somepassword</password> <!-- Remove this option if there is no password -->
</proxy>
</proxies>
</settings>
The official maven docs for this are here.
Note: If you take your work laptop home and you don't VPN into the company network, you will have to disable this proxy in order for maven to work at home.
I have a Maven project and added db4o as a dependency using this answer from a previous question. When I compile the project it gives me the following error:
Could not resolve dependencies for
project
org.uca.dss:trenes:jar:1.0-SNAPSHOT:
[...] Failed to read artifact
descriptor for
com.db4o:db4o-full-java5:jar:7.13-SNAPSHOT:
Could not transfer artifact
com.db4o:db4o-full-java5:pom:7.13-SNAPSHOT
from/to source.db4o
(https://source.db4o.com/maven/):
Error transferring file:
sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification
path to requested target -> [Help 1]
Curiously enough, it only happens in Ubuntu GNU/Linux (tested in two PC's), but not in Windows (using NetBeans 7.0).
I can post the full error (from maven -X output), but I think it does not add much information
Edit 1:
This is what I have in my pom.xml file regarding db4o:
<repository>
<id>source.db4o</id>
<url>https://source.db4o.com/maven/</url>
</repository>
...
<dependency>
<groupId>com.db4o</groupId>
<artifactId>db4o-full-java5</artifactId>
<version>7.13-SNAPSHOT</version>
</dependency>
This looks like a security certificate issue for a secured request which is generally looked up from %JAVA_HOME%\jre\lib\security\cacerts . I am guessing your windows JRE has the entries whereas the ubuntu JRE is lacking them.
By the way this link is a good read on installing certs. You probably want to use the option 1 mentioned there.