Recent Maven Artifact Resolver versions have a "Trusted Checksums" feature. As mentioned for example in this Reddit comment it seems that feature can be used to ensure artifact integrity and protect against some aspects of supply chain attacks. And it seems to be more secure than external Maven plugins trying to provide this functionality, since there the plugin itself (and other plugins) are downloaded before integrity verification can be performed.
However, I am currently having these problems with it:
- It only works for recent Maven versions
If you accidentally use an older version integrity verification will not be performed - It seems you have to provide the
aether.trustedChecksumsSource.*andaether.artifactResolver.postProcessor.trustedChecksums.*arguments (see also documentation) on the command line
This is quite cumbersome and easy to forget, and it seems to not be possible to enable it in thepom.xml - By default
aether.trustedChecksumsSource.summaryFile.basediris relative to the local Maven repository
This makes it difficult to add the file to Git for the Maven project, so that it can be shared with other developers. Additionally using expressions such as${project.basedir}as value seems to not work.
I am using Maven version 3.9.8.
What is a good way to use the "Trusted Checksums" feature, ideally solving all the problems mentioned above?