Issue
I got an error when I try to build my project using Jenkins
> [ERROR] Failed to execute goal on project luwak-task-storage: Could not resolve dependencies for project
> com.trendmicro.luwak:luwak-task-storage:jar:3.0.0-SNAPSHOT: Failed to
> collect dependencies at org.bouncycastle:bc-fips:jar:1.0.2.3: Failed
> to read artifact descriptor for org.bouncycastle:bc-fips:jar:1.0.2.3:
> Could not transfer artifact org.bouncycastle:bc-fips:pom:1.0.2.3
> from/to central
> (https://nexus.trendmicro.com/nexus/repository/maven-central/):
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> find valid certification path to requested target -> [Help 1]
I got a dependency called org.bouncycastle:bc-fips:pom:1.0.2.3, it is the library that cannot be resolved, but I don't know why. I can build my project successfully on local, but when using Jenkins, I got this error. I have read some threads but none of them resolve my issue. Please help.
Solution
I got a dependency called org.bouncycastle:bc-fips:pom:1.0.2.3, it is the library that cannot be resolved, but I don't know why?
Because your server don't have that dependency/library yet and failed prior to get those required artifacts due to the following reason:
Your system (Jenkins server) is unable to validate the server identity from where it is trying pulling the artifacts and hence unable to establish a proper channel for communication.
If you recognized & trust target server then you can add the CA certs on Jenkins server (most probably in java keystore utilize by Jenkins) to validate the handshake process.
https://stackoverflow.com/a/63491078/9926179
Answered By - harry
Answer Checked By - Katrina (JavaFixing Volunteer)