java - Maven PKIX path building failed - Stack Overflow

admin2025-04-29  2

I tried to run nab-example from here and got an error when building the project with maven clean package Error:

[ERROR]   The project ru.hh.nab:nab-example:10.1.4-SNAPSHOT (C:\Users\╨Ь╨░╨║\IdeaProjects\nuts-and-bolts\nab-example\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for ru.hh.nab:nuts-and-bolts-parent:10.1.4-SNAPSHOT: The following artifacts could not be resolved: ru.hh.public-pom:public-pom:pom:1.57.2 (ab
sent): Could not transfer artifact ru.hh.public-pom:public-pom:pom:1.57.2 from/to hh-public (): PKIX path building failed: sun.
security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM @ ru.hh.nab:nuts-and-bolts-parent:10.1.4-SNAPSHOT, C:\Users\╨Ь╨░╨║\IdeaProjects\nuts-and-bolts\pom.xml, line 5, column 13 -> [Help 2]

I tried to add certificate like in this answer and ignore certificate like here but got the same error. I use jdk-21 and windows 11. Computer is my own and i believe that i don't have proxies

I tried to run nab-example from here and got an error when building the project with maven clean package Error:

[ERROR]   The project ru.hh.nab:nab-example:10.1.4-SNAPSHOT (C:\Users\╨Ь╨░╨║\IdeaProjects\nuts-and-bolts\nab-example\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for ru.hh.nab:nuts-and-bolts-parent:10.1.4-SNAPSHOT: The following artifacts could not be resolved: ru.hh.public-pom:public-pom:pom:1.57.2 (ab
sent): Could not transfer artifact ru.hh.public-pom:public-pom:pom:1.57.2 from/to hh-public (https://m2.hh.ru/content/repositories/public-releases): PKIX path building failed: sun.
security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM @ ru.hh.nab:nuts-and-bolts-parent:10.1.4-SNAPSHOT, C:\Users\╨Ь╨░╨║\IdeaProjects\nuts-and-bolts\pom.xml, line 5, column 13 -> [Help 2]

I tried to add certificate like in this answer and ignore certificate like here but got the same error. I use jdk-21 and windows 11. Computer is my own and i believe that i don't have proxies

Share Improve this question asked Jan 6 at 23:27 MorsennMorsenn 111 bronze badge 2
  • It looks like the repository defined in pom.xml m2.hh.ru/content/repositories/public-releases isn't accessible. – Raghuram Commented Jan 7 at 10:08
  • I can open it through browser and see code. Why it isn't accesssible? – Morsenn Commented Jan 7 at 14:51
Add a comment  | 

1 Answer 1

Reset to default 0

This is a pretty common issue — mainly because Java uses its own keystore, separate from the OS.

And for such a small and frequent problem, Java’s built-in tooling makes it a real headache to fix.

Normally, you’d need to:
1. Obtain the certificate from the repository server
2. Download and convert it
3. Use the keytool with a small novel’s worth of parameters to import it correctly into the Java keystore

That’s why I built a tool to make this whole process more convenient: jssl.
(see https://github.com/pmamico/jssl)

Instead of all the hassle, you can just run:

mvn clean install | jssl doctor

Of course, you’ll need to install jssl once beforehand. But after that, whenever you hit a PKIX error again, you’ll be able to resolve it in seconds.

Hope this saves someone a few hours of pain.

转载请注明原文地址:http://anycun.com/QandA/1745939412a91399.html