nicoulaj / checksum-maven-plugin

Compute Maven project artifacts/dependencies/files checksum digests.
https://checksum-maven-plugin.nicoulaj.net
Apache License 2.0
42 stars 40 forks source link

checksum-maven-plugin "artifacts" appends wrong filename #137

Open reckart opened 2 years ago

reckart commented 2 years ago

There are cases where the filename of an artifact that is attached to the build does not match the filename under which the artifact actually ends up in the repository. When the "artifacts" goal is used, we usually want to calculate hashes for the files that get deployed into the repository. If we use the appendFilename option, then it is usually to be able to run a command like sha512sum -c *.sha512 to check if the hashes for the hashed files are valid. However, if the original filename of the attached artifact differs from the name it ends up under in the repository, then this fails because the filename in the .sha512 file ends up being wrong.

For example, Tycho may attach a file p2content.xml as an artifact to the build such that it gets written to the repository as org.apache.uima.ruta.feature-3.2.0-p2metadata.xml. When we apply checksum-maven-plugin:1.11:artifacts in such a case, we get a file org.apache.uima.ruta.feature-3.2.0-p2metadata.xml.sha512, but its content is:

<hash>   p2content.xml

The content should instead be

<hash>   org.apache.uima.ruta.feature-3.2.0-p2metadata.xml