I'm running into a strangeissue. I have this legacy multi module project and the "mvn clean package" is running successfully both from command line and using the intellij maven extension. Anyway if I sync the project by using the same maven extension it fails and says that some dependency cannot be resolved and some maven plugin dependency too.....I cannot really understand what I did wrong and why syncing the project fails even if it builds and everything seems ok. I'm on maven 3.6.3 (tried both my local instance and the bundled one with intellij idea) jdk is 11 but the whole project is jdk 1.6 specified throught maven compiler plugin config (not my fault the java 1.6)
EDIT: Forgot to mention. I have no compilation error, the error while doing sync on maven extension is "Could not transfer artifact xxx" from remote company artifactory repository (but it's working when doing mvn clean package from command line, and it's also in my local .m2 of course)
Here is the error I see when doing sync:
Could not transfer artifact xml-apis:xml-apis:jar:1.3.02 from/to my.company.net (artifactory)
...
Caused by: java.lang.RuntimeException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
But I already added my company certificat into File | Settings | Tools | Server Certificates as reported here And also to java cacert...
Even if I try specific plugin versions it doesn't work at all.
If I run the IDE by using a dedicated JDK (and add the certificate to it's cacert) it works....so basically I'm not able to add a certificate to the bundled jre
I fixed it by running the "Importing" with dedicated jdk. Go to Settings | Build, Execution, Deployment | BuildTools | Maven | Importing/Runner
I will try to figure out if removeing the certificate from java cacert and using the provided UI (File | Settings | Tools | Server Certificates) on Intellij will provide the same outcome.