2

I am trying to install maven for the 1st time and seeing below issues when trying to do a maven force update to get the jars to my local repository. I am able to see the property file, jar and jar.sha1 but the .pom and .pom.sha1 is not getting updated. When i go to the specific folder i see this file instead

maven-clean-plugin-3.0.0.pom.lastUpdated

This is happening to all the folders in my repository. The content inside this .lastUpdated file is

#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Sat Nov 04 22:38:58 EDT 2017
https\://artifactory.cen.gov/artifactory/repo/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:3.0.0 from/to repo (https\://artifactory.cen.gov/artifactory/repo)\: com.ibm.jsse2.util.h\: PKIX path building failed\: java.security.cert.CertPathBuilderException\: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is\: \n\tjava.security.cert.CertPathValidatorException\: The certificate issued by CN\=CENInternalRootCA, OU\=cen Service, O\=U.S. Government, C\=US is not trusted; internal cause is\: \n\tjava.security.cert.CertPathValidatorException\: Certificate chaining error
@proxy.cen.gov\:8080>@default-repo-https\://artifactory.cen.gov/artifactory/repo/.lastUpdated=1509849538349

I had this certificate chaining exception earlier but got rid after adding proper certificate and creating keystore and adding them to env variables. Because of this error i am not able to do a maven clean or run as maven install. Any suggestions please?

Geek
  • 3,187
  • 15
  • 70
  • 115
  • Hi any suggestions please ? – Geek Nov 05 '17 at 07:41
  • Your question and its tagging is a bit misleading. You experience a certificate chaining error when contacting a specific web resource - the problem is not directly connected to Maven or POMs, but probably a kind of network issue. – J Fabian Meier Nov 05 '17 at 08:53
  • First you are running on IBM Java...not on Oracle Java furthermore the problem is located based on the certificate problem...at first...Please solve this issue first...before we can go further... – khmarbaise Nov 05 '17 at 12:32

1 Answers1

0

When you already got rid of your certificate problem, you can force an update by using

mvn clean install -U

-U,--update-snapshots Forces a check for missing releases and updated snapshots on remote repositories

Otherwise you can delete your local repository. This is a very effective way to force Maven to re-download all dependencies, but the next build may take a substantial ammount of time, depending on the number of dependencies.

The repository is located in ~/.m2/repository by default. Otherwise its location is configured by the <localRepository> setting in settings.xml.

See also Force maven update

If the problem with your certificate chain still exists, Maven will not be able to download the dependencies and you will get the same .lastUpdated files again

SilverNak
  • 3,283
  • 4
  • 28
  • 44
  • I did remove the local repository and tried multiple times and getting the same issue. Maven update works good but while doing a maven clean the .pom and .pom.sha1 wouldn't get uploaded instead getting lastUpdated file. – Geek Nov 05 '17 at 13:38