# Generate SHA256 when uploading files using maven

**URL:** <https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041>\
**Category:** Sonatype Nexus Repository\
**Created:** [October 2, 2020, 7:05am UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041 "2020-10-02T07:05:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralph.dietzel](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ralph.dietzel](https://community.sonatype.com/u/ralph.dietzel)\
**Post date:** [October 2, 2020, 7:05am UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041/1 "2020-10-02T07:05:38Z")

</div>

We are currently using Nexus Repository Manager OSS 3.22.1-02.

We have several maven2-repositories to which we uploading files using the Nexus-web-frontend and maven.  
When i deploy a file using maven (mvn deploy:deploy-file …), there is only a MD5 and SHA1 checksum available, but not a SHA256 (which is needed for our further processing).  
When i upload the file using the Nexus-web-frontend, the SHA256 is created properly.  
Is there a way to generate the SHA256 using maven deploy?

---

<div class="post-metadata">

**Author:** ![msymons](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@msymons](https://community.sonatype.com/u/msymons)\
**Post date:** [October 5, 2020, 8:37am UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041/2 "2020-10-05T08:37:59Z")

</div>

Looks like this will be functionality that will be included in Apache Maven Artifact Resolver 1.6.1 via [MRESOLVER-56](https://issues.apache.org/jira/browse/MRESOLVER-56). All isssues that are scheduled for this release of Resolver are complete, so let’s hope that it will make it into the upcoming Maven 3.7.0 release (and from there into Maven Deploy Plugin).

---

<div class="post-metadata">

**Author:** ![jamlevi66](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jamlevi66](https://community.sonatype.com/u/jamlevi66)\
**Post date:** [January 18, 2025, 12:39am UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041/3 "2025-01-18T00:39:56Z")

</div>

Reviving old thread, because I cannot find answer in docs…  
I see that Nexus now calculates md5, sha1, sha256 & sha512, but only creates md5 & sha1 files for components. _Is that configurable?_ My use case is downloading xyz.jar & xyz.jar.sha1 via api and verifying the jar using sha1sum - but I would prefer to use sha256 / sha256sum.

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [January 21, 2025, 9:24pm UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041/4 "2025-01-21T21:24:10Z")

</div>

Nexus only creates checksum files for metadata that the server builds, otherwise for maven it is the responsibility of the client to upload the checksums. Likely this indicates the version of maven you’re using does not create the other checksum files.

---

<div class="post-metadata">

**Author:** ![jamlevi66](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jamlevi66](https://community.sonatype.com/u/jamlevi66)\
**Post date:** [January 22, 2025, 7:41pm UTC](https://community.sonatype.com/t/generate-sha256-when-uploading-files-using-maven/5041/5 "2025-01-22T19:41:08Z")

</div>

Thank you @mpiggott - Yes, I have been flip-flopping back and forth as to whether maven creates & uploads these files to Nexus OR Nexus creates them when components are uploaded, it’s a mystery, as I can’t seem to find documentation on either possibility. I see no indication of md5 or sha1 files uploading in my build logs when pom, jar, war, etc are built/uploaded, using maven-3.9.

It’s okay though, because I can use the nexus-api to grab the SHA-256 quite easily.
