halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
455 stars 86 forks source link

Plugin does not retain downloaded java archive after install #125

Open gurpreet3737 opened 3 years ago

gurpreet3737 commented 3 years ago

After installing java, plugin deletes downloaded java archive from /tmp directory, even after setting configuration in .asdfrc file to not to remove package after install.

There should be a way to retain archive who wish to retain it in asdf_install_dir, possibly in archives folder, so that one can copy the archives to other system and perform install from the same, instead of downloading them again and again.

joschi commented 3 years ago

After installing java, plugin deletes downloaded java archive from /tmp directory, even after setting configuration in .asdfrc file to not to remove package after install.

@gurpreet3737 Which configuration setting are you using for this?

gurpreet3737 commented 3 years ago

I appended configuration "always_keep_download = yes" in the asdfrc file for retaining the downloaded archive as specified in the asdf documentation. But plugin still removes the archive file. I manually configured function install in the function file to copy the downloaded archive to a separate folder "archives" before removing it. functions.txt

Changes in the file are in the lines 68, 80-83, and 99.

I know this is not a clean solution, but for the time being it solved my problem. But after the plugin update all my changes were removed. Please add this functionality in the plugin.

delgurth commented 3 years ago

I was looking into this issue, because for testing "my issue" I downloaded the same JVM version quite some times. Unfortunately "the proper fix" was not trivial and I've started a discussion about this feature on the ASDF GitHub repository: https://github.com/asdf-vm/asdf/discussions/905.