JarsDownloader must be sensitive to semantic versioning and file creation date
At present JarsDownloader will aggresively cache all files and it will do so without consideration about their source.
The reason why this needs to be addressed is because:
- Caching only can work correctly when there are guarantees of immutability. Typically this is achieved with semantic versioning of jar names.
- Artefacts from different repositories cannot be guaranteed to be the same. Even if they have the same version number.
- An artefact with SNAPSHOT semantic versioning is NOT immutable by definition and should not be immutably cached.
- The same goes for a jar without any versioning information.
- Any artefact from the local filesystem does not require any caching.
For example:
-
https://some.repo/group/name-1.0.0.jar
is cached to~/.downloaded-cordapps/name-1.0.0.jar
. This is incorrect. It should be cached to~/.downloaded-cordapps/some.repo/group/name-1.0.0.jar
. -
https://another.repo/group/name-1.0.0.jar
andhttps://my.repo/group/name-1.0.0.jar
are cached incorrectly to the same file. They should be distinct by repo name. -
https://some.repo/group/name-1.0.0-SNAPSHOT.jar
is aggressively cached ONCE only. The downloader must only aggresively cache if the filename has an immutable semantic version. This means also that files without any versioning should be re-downloaded.
Edited by Fuzz