1

I am using maven build in my project. I have a corporate nexus repository in our local network. This repository is hosted over https.

I am facing issues accessing this repository from eclipse.

The error displayed is:

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
    - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor 
     for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from https://
     NexusServer/nexus/content/groups/CLM/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original 
     error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to nexus (https://NexusServer/nexus/content/groups/CLM/): 
     sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)

I googled a bit and found a solution to pass the certificate while running maven build. I downloaded the certificate and passed it to maven using -Djavax.net.ssl.trustStore=Path/To/My/KeyStore

The command line tool works fine. However, I am still not able to build the project using maven in eclipse.

Maven does not download new dependencies form the local repository.

Thanks in advance for you help!

Prabodh

Prabodh Mhalgi
  • 805
  • 9
  • 25

1 Answers1

2

Your Nexus is using an SSL certificate which is not considered to be valid by the Java running Eclipse. This is because the certificate in Nexus was not signed by a trusted root certificate authority such as Verisign.

You'll need to install the public certificate in Nexus into the Java truststore of the Java running Eclipse to fix this, then it will be trusted. You can use our import-ssl.jar utility to help you with this, see section 24.2.3 here:

https://books.sonatype.com/nexus-book/reference/ssl-sect-client-cert.html

rseddon
  • 5,082
  • 15
  • 11
  • Thanks! I downloaded the certificate. Now it seems that eclipse is able to connect to my nexus repository. If I run "Update Project" the update completes successfully. Earlier, it used to stuck forever trying to connect to nexus. However, the errors mentioned above still persist. If I add a new dependency, the jars are not automatically downloaded. If I run the maven eclipse plugin (mvn eclipse:eclipse) from command line, the jars are downloaded and are seen in "Referenced Libraries". – Prabodh Mhalgi Jun 30 '15 at 19:44