Eclipse 2020.12 now includes Oracle JDK 14 with the installation. This breaks Maven integration if your corporation has a CA (which most large places do).
How does one add a corporate certificate to the Eclipse JDK? I tried the following:
find /Applications/Eclipse.app -iname cacerts -exec keytool -importcert -alias emoneyusa-ecdsa -keystore {} -storepass changeit -file ~/Documents/certs/corp-ca.crt -trustcacerts -noprompt ;
However, I still get this problem when attempting to perform Maven functions inside Eclipse:
org.eclipse.core.runtime.CoreException: Could not resolve artifact xalan:xalan:jar:sources:2.7.2
at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$4(MavenImpl.java:804)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:772)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:749)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.download(DownloadSourcesJob.java:330)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadAttachments(DownloadSourcesJob.java:304)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadMaven(DownloadSourcesJob.java:269)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadFilesAndPopulateToUpdate(DownloadSourcesJob.java:233)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.lambda$0(DownloadSourcesJob.java:161)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.run(DownloadSourcesJob.java:161)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Contains: Failure to transfer xalan:xalan:jar:sources:2.7.2 from https://nexus.xxx.com/repository/xxx-all was cached in the local repository, resolution will not be reattempted until the update interval of xxx-all has elapsed or updates are forced. Original error: Could not transfer artifact xalan:xalan:jar:sources:2.7.2 from/to xxx-all (https://nexus.xxx.com/repository/xxx-all): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer xalan:xalan:jar:sources:2.7.2 from https://nexus.xxx.com/repository/xxx-all was cached in the local repository, resolution will not be reattempted until the update interval of xxx-all has elapsed or updates are forced. Original error: Could not transfer artifact xalan:xalan:jar:sources:2.7.2 from/to xxx-all (https://nexus.xxx.com/repository/xxx-all): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:225)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:193)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:559)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:483)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:207)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:262)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$4(MavenImpl.java:781)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:772)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:749)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.download(DownloadSourcesJob.java:330)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadAttachments(DownloadSourcesJob.java:304)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadMaven(DownloadSourcesJob.java:269)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.downloadFilesAndPopulateToUpdate(DownloadSourcesJob.java:233)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.lambda$0(DownloadSourcesJob.java:161)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374)
at org.eclipse.m2e.jdt.internal.DownloadSourcesJob.run(DownloadSourcesJob.java:161)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
What clued me in was Eclipse reports this JDK, which is funny because I only have AdoptOpenJDK11 installed:
eclipse.buildId=4.17.0.I20200902-1800
java.version=14.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/xxx/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/xxx/.eclipse_keyring
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…