Wednesday, September 12, 2018

Maven project error in the Eclipse

When using Eclipse to import or create a new Maven project, got the below error:
Description Resource Path Location Type
Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from https://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 org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 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 pom.xml /dbutil line 1 Maven Configuration Problem

Since it mentions "Failure to transfer ... maven-compiler-plugin:3.1", the first thing is to check
.m2\repository\org\apache\maven\plugins\maven-compiler-plugin\3.1
And the jar file is not there.

Solution:
From command line, run "mvn install -U", and verify the jar is there.
Then from Eclipse, delete the project (keep the contents), and then import it as Maven project. Now the error is gone
May need run from Eclipse, right click the project, Maven->Update Project

No comments:

Post a Comment