0

Background

I am trying to bring up my grails project, which stopped building all of a sudden (probably due to me playing around with my local maven repository). Now when I run the grails command, I get the following errors -

org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for xalan:serializer:jar:2.7.1
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:537)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:521)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:421)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:375)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:266)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:337)
    at grails.util.BuildSettings.doResolve(BuildSettings.groovy:514)
    at grails.util.BuildSettings.doResolve(BuildSettings.groovy)
    at grails.util.BuildSettings$_getDefaultBuildDependencies_closure19.doCall(BuildSettings.groovy:775)
    at grails.util.BuildSettings$_getDefaultBuildDependencies_closure19.doCall(BuildSettings.groovy)
    at grails.util.BuildSettings.getDefaultBuildDependencies(BuildSettings.groovy:769)
    at grails.util.BuildSettings.getBuildDependencies(BuildSettings.groovy:674)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact xalan:serializer:pom:2.7.1 from/to repo1_maven_org_maven2 (https://repo1.maven.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:462)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:264)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:241)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
    ... 14 more

I followed this blog https://stackoverflow.com/a/36427118/351903 and added the certificate of the remote server to my Cacerts, but am now getting these errors -

sun.security.validator.ValidatorException: KeyUsage does not allow digital signatures

I tried to manually download the artefacts and then observed that this error resolves for that one and shows for the next artefact. So, I thought, if I could list down all the file names in a url like this https://repo1.maven.org/maven2/org/grails/grails-bootstrap/2.4.0/ and then curl all the file names and create them on my local, I could resolve this one by one for my dependencies, like this -

curl https://repo1.maven.org/maven2/org/grails/grails-bootstrap/2.4.0/grails-bootstrap-2.4.0-javadoc.jar -o 'grails-bootstrap-2.4.0-javadoc.jar'

However, I am however, unable to list down all the files for an artefact -

SandeepanNath:Desktop sandeepan.nath$ ssh https://repo1.maven.org ls -l /maven2/org/grails/grails-bootstrap/2.4.0/
ssh: Could not resolve hostname https://repo1.maven.org: nodename nor servname provided, or not known
SandeepanNath:Desktop sandeepan.nath$ 

Trying with the IP -

SandeepanNath:Desktop sandeepan.nath$ ssh 151.101.36.209 ls -l /maven2/org/grails/grails-bootstrap/2.4.0/
ssh: connect to host 151.101.36.209 port 22: Operation timed out

Then I understood that the only option I have is to scrape the url looking for links and then doing curl. But, I am unable to scrape as well due to ssl errors. I tried following this python example - https://www.geeksforgeeks.org/implementing-web-scraping-python-beautiful-soup/?ref=lbp

#This will not run on online IDE
import requests
from bs4 import BeautifulSoup
import ssl

URL = "http://www.values.com/inspirational-quotes"
r = requests.get(URL)

soup = BeautifulSoup(r.content, 'html5lib')
print(soup.prettify())

But I get this error -

Traceback (most recent call last):
  File "parse_remote.py", line 7, in <module>
    r = requests.get(URL) 
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 665, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 245, in resolve_redirects
    **adapter_kwargs
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/Users/sandeepan.nath/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.values.com', port=443): Max retries exceeded with url: /inspirational-quotes (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
  • these errors are very weird to have. what java and maven version are you running? is there a proxy in between your maven setup and maven central? – wemu Jun 06 '20 at 09:37
  • How do I check that? I am able to download these artefacts from the default maven repository by creating a new maven project and adding these to pom files. – Sandeepan Nath Jun 06 '20 at 13:38
  • does that other project use the same maven settings / version? To check what you work with you can use 'mvn -v' and 'mvn help:effective-settings' and 'mvn help:effective-pom' to see if some configuration is picked up or inherited. If some of the commands are executed within an IDE make sure the settings there do not differ from the cli configuration. Sometimes deleting the local maven repository helps with very weird issues as well. – wemu Jun 06 '20 at 20:35
  • Yes maven version and effective settings are same. – Sandeepan Nath Jun 07 '20 at 16:48
  • Which Java version do you use? – khmarbaise Jun 07 '20 at 19:09

0 Answers0