williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
7.23k stars 258 forks source link

[java-debug-adapter & jdtls] Install older versions of packages #1661

Open gbroques opened 3 months ago

gbroques commented 3 months ago

I'm trying to install an older version of java-debug-adapter with the following command:

:MasonInstall java-debug-adapter@0.46.0

However, I see the following error due to com.microsoft.java.debug.plugin-0.50.0.jar not existing in that older version:

    ◍ java-debug-adapter
      ▼ Displaying full log
        Fetching available versions…
        Downloading file "https://open-vsx.org/api/vscjava/vscode-java-debug/0.46.0/file/vscjava.vscode-java-debug-0.46.0.vsix"…
        Unpacking "vscjava.vscode-java-debug-0.46.0.vsix"…
        Link target "C:\\Users\\gbroques\\AppData\\Local\\nvim-data\\mason\\packages\\java-debug-adapter\\extension/server/com.microsoft.java.debug.plugin-0.50.0.jar" does not exist.

Is there a way to override the com.microsoft.java.debug.plugin-0.50.0.jar with com.microsoft.java.debug.plugin-0.42.0.jar which is the version java-debug-adapter@0.46.0 contains?

Another idea is to look for any version with a glob pattern such as com.microsoft.java.debug.plugin-*.jar.


jdtls has a similar limitation due to the download URL containing a timestamp, 202402151717, and the versioned share dependency.

:MasonInstall jdtls@v1.24.0
    ◍ jdtls
      ▼ Displaying full log
        Fetching available versions…
        Downloading file "https://download.eclipse.org/jdtls/milestones/1.24.0/jdt-language-server-1.24.0-202402151717.tar.gz"…
        spawn: powershell failed with exit code 1 and signal 0. iwr : The remote server returned an error: (404) Not Found.
        At line:1 char:160
        + ... pe]::Tls12; iwr -Headers @{"User-Agent"="mason.nvim v1.10.0 (+https:/ ...
        +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc 
           eption
            + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

        Failed to download file "https://download.eclipse.org/jdtls/milestones/1.24.0/jdt-language-server-1.24.0-202402151717.tar.gz".

The correct download URL for 1.24.0 is: https://www.eclipse.org/downloads/download.php?file=/jdtls/milestones/1.24.0/jdt-language-server-1.24.0-202306011728.tar.gz


Related Issues:

Related Discussions: