sdkman / sdkman-db-migrations

Database migrations for the sdkman API
Apache License 2.0
71 stars 124 forks source link

Bug: Cannot install Maven 3.8.7 #636

Closed rickie closed 1 year ago

rickie commented 1 year ago

Bug report We are unable to install Maven 3.8.7 with the SDKMAN CLI. It's probably using the wrong URL to try and download 3.8.7, namely:

https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip

Instead of:

https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.zip

To reproduce

$ sdk install maven 3.8.7

Downloading: maven 3.8.7

In progress...

############################################################################################################################################################################################################ 100,0%
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/rick/.sdkman/tmp/maven-3.8.7.zip or
        /home/rick/.sdkman/tmp/maven-3.8.7.zip.zip, and cannot find /home/rick/.sdkman/tmp/maven-3.8.7.zip.ZIP, period.

Stop! The archive was corrupt and has been removed! Please try installing again.

System info

$ lsb_release -a
Description:    Ubuntu 20.04.5 LTS
Release:    20.04

$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)

$ sdk version
SDKMAN!
script: 5.18.0
native: 0.1.3
marc0der commented 1 year ago

Not a CLI bug so transferring it.

tessneau commented 1 year ago

I'm running into the same issue, copying over my report from slack https://sdkman.slack.com/archives/CJTNQA94M/p1680886237947579 . It does seem to be searching in the wrong URL as @rickie mentioned.

shell

zsh 5.8 (x86_64-apple-darwin21.0)

sdkman version

SDKMAN!
script: 5.18.1
native: 0.2.2
helpermethod commented 1 year ago

dlcdn.apache.org seems to only keep the latest minor versions:

https://dlcdn.apache.org/maven/maven-3/

@aalmiray Would switching to archive.apache.org work?

aalmiray commented 1 year ago

Bummer. We definitely have to update the db.

tessneau commented 1 year ago

in the meantime, is there a good way that I can install maven 3.8.7 directly and move it to a folder where sdkman can pick it up?

aalmiray commented 1 year ago

@helpermethod is there a way to batch update the maven candidate directly at the db or do we have to write a custom migration for it?

aalmiray commented 1 year ago

Recommended link is https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/

marc0der commented 1 year ago

Hey all, I ran a migration that fixed all the URLs for maven. Please let me know if that does the trick for you.