fxlauncher icon indicating copy to clipboard operation
fxlauncher copied to clipboard

Old versioned jars are not deleted

Open boopac opened this issue 6 years ago • 8 comments

Hi, if i update a library (controlsfx-8.40.13 -> controlsfx-8.40.14) the old jar files are not deleted.

With maven i build the new app.xml which contain the tag for controlsfx-8.40.14.jar. I copy the new controlsfx-8.40.14.jar to the URL and delete controlsfx-8.40.13.jar.

But after using fxlauncher I have both files on the client: controlsfx-8.40.13.jar (not deleted) controlsfx-8.40.14.jar (new downloaded)

Is there a possibility to delete the fiels that are not in app.xml with fxlauncher?

King regards, Boris

boopac avatar Aug 31 '18 15:08 boopac

No you can't but it will not be dynamically loaded onto the JVM if it is not present in the manifest.

if you really want, your artifacts should not have a version string so newer will overwrite older. In case it's already released, rename the new version to match the older.

mordechaim avatar Aug 31 '18 16:08 mordechaim

Thanks @mordechaim - I agree. We could have added a feature to delete old artifacts, but that's a bit dangerous, and since we can remove the need for it by simply removing version numbers that's a safer approach IMO.

edvin avatar Aug 31 '18 18:08 edvin

@mordechaim: that's right, but then you have a lot of garbage files, if the artifacts have new versions.

@edvin: if you remove the version number, you can't see on client site if there is the right versions of the artifacts.

Maybe in a later version of fxlauncher there is a parameter for "--remove-old-artifacts".

boopac avatar Sep 05 '18 12:09 boopac

You can include a version number in your app perhaps? I agree, this could absolutely be added as a new feature :)

edvin avatar Sep 05 '18 12:09 edvin

That's would be pretty cool :+1:

boopac avatar Sep 05 '18 12:09 boopac

You will have to add more entries in the manifest, namely 'deletes'. Otherwise how would we know what's an old artifact?

Do you think it's still in the scope of this framework? One could easily do the deletes theirselves in the actual app; it doesn't need to be done anywhere before the launch process. Just my opinion.

mordechaim avatar Sep 05 '18 14:09 mordechaim

We'd have to have a designated artifacts-folder so it would be safe for FXLauncher to delete any files not mentioned in the manifest. This could be done after the new version has been downloaded successfully.

edvin avatar Sep 05 '18 16:09 edvin

You are right! It does fit the framework.

My mistake because I came from my update4j that doesn't have the concept of cachedir, instead you can save files anywhere on the user machine.

mordechaim avatar Sep 05 '18 16:09 mordechaim