Open LanHikari22 opened 1 month ago
The address is using the "Official search by the maintainers of [Maven](https://maven.apache.org/) Central Repository". But, I just clicked on "API Guide", then one of the queries, and the page times out. I think the web service is unreliable. It might be best to use https://central.sonatype.com/?smo=true. It has an API.
504 ERROR
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID: xGTki_3-jx8ZdW05RJj75iD0N_M_kls3O1UpAEEG1dWcY8qzr_nV2w==
Actually, the sonatype.com website points to the maven.org API. Not much we can do here in so far as using this API. It might be better to just query https://repo1.maven.org/maven2/org/antlr/antlr4/, which appears to be more reliable, and just scan for the latest.
Perhaps something like this? (I am not a Python programmer, but it "works".)
def latest_version():
page = requests.get("https://repo1.maven.org/maven2/org/antlr/antlr4/")
tree = html.fromstring(page.content)
x = tree.xpath('//a/text()')
if '../' in x: x.remove('../')
if 'maven-metadata.xml' in x: x.remove('maven-metadata.xml')
if 'maven-metadata.xml.md5' in x: x.remove('maven-metadata.xml.md5')
if 'maven-metadata.xml.sha1' in x: x.remove('maven-metadata.xml.sha1')
if 'maven-metadata.xml.sha256' in x: x.remove('maven-metadata.xml.sha256')
if 'maven-metadata.xml.sha512' in x: x.remove('maven-metadata.xml.sha512')
cleaned_data = [item.rstrip('/') for item in x]
cleaned_data.sort(key=Version)
last_element = cleaned_data[-1]
return last_element
Following the instructions in https://github.com/antlr/antlr4/blob/4.13.2/doc/getting-started.md,
I first created a miniconda environment for antlr and then proceeded with installing antlr4-tools:
I then attempted to install the java app with
and that produced the following error log:
The suspect line is the following:
I am unable to curl nor access this URL in my browser. However, I saw instructions on StackOverflow from user kaby76 (https://stackoverflow.com/q/78059474) to instead run
and that did allow me to acquire the CLI tool:
Thanks, Mohammed