GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Allow a plugin to be purged from cache #91

Open greenwoodma opened 5 years ago

greenwoodma commented 5 years ago

If a plugin is corrupted on disk (during a failed download for instance) then it will fail to load and currently the only way to get it working again is to manually remove the files from the users ~/.m2 folder.

One solution would be to add a button to the plugin manager allowing a cached copy of a plugin to be purged from the local cache.

A useful side effect of this would be that you could purge a SNAPSHOT plugin in order to ensure you got the latest version bypassing the 24 hour waiting period between checks. See #74

greenwoodma commented 4 years ago

Obviously this should involve purging the jar for the plugin artifact, but what about it's dependencies? They could just as easily be corrupted. I think it would get way too complex though, so I'm assuming we should just focus on removing the main jar file.

johann-petrak commented 4 years ago

The download mechanism does not verify a file content checksum to make sure the download was successful? Is there no way to enable this? When I look at the files in a maven repo, I see md5 and sha1 checksum files so I would have assumed that in most cases this should get detected by the downloader (except maybe when a process gets killed right between failed download and verification and there is no mechanism to recheck later). Obviously if that would be available, it would also work for the dependencies. Similar for the snapshot refresh: is there no way in the download mechanism to force a refresh or override a default waiting period through the API?

greenwoodma commented 4 years ago

Good question. Verifying the checksum would be a useful step even if we still want to add the ability to purge from the cache.

As far as I remember there wasn't an obvious way of forcing a refresh of the snapshot versions also, and we've discussed this before, we don't want to force a check everytime on SNAPSHOT plugins, but when I figure out the checksum I'll have another look at what the options are.