Choose URL matching the hash of the local artifact #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the behavior of mvn2nix such that it uses the URL which matches the hash of the artifact in the local repository. This should solve mismatches such as reported in Issue #29. The URL of an artifact is determined by retrieving the artifact from the URL, computing its SHA256 and comparing it to the SHA256 of the local artifact. As a consequence each artifact has to be downloaded at least once for the creation of the lockfile.
Furthermore, I have abstracted parts of the algorithm in order to make unit testing somewhat easier. In particular, the PR includes a test that produces a hash mismatch which is fixed by the new way to choose the artifact URL.