MessageDigest Maven Assembly Handler

Calculates message digest file for the contents in a Maven archiver archive

License

License

GroupId

GroupId

de.sfuhrm
ArtifactId

ArtifactId

message-digest-assembly-handler
Last Version

Last Version

0.9.2
Release Date

Release Date

Type

Type

jar
Description

Description

MessageDigest Maven Assembly Handler
Calculates message digest file for the contents in a Maven archiver archive
Project URL

Project URL

https://github.com/sfuhrm/message-digest-assembly-handler
Source Code Management

Source Code Management

https://github.com/sfuhrm/message-digest-assembly-handler.git

Download message-digest-assembly-handler

How to add to project

<!-- https://jarcasting.com/artifacts/de.sfuhrm/message-digest-assembly-handler/ -->
<dependency>
    <groupId>de.sfuhrm</groupId>
    <artifactId>message-digest-assembly-handler</artifactId>
    <version>0.9.2</version>
</dependency>
// https://jarcasting.com/artifacts/de.sfuhrm/message-digest-assembly-handler/
implementation 'de.sfuhrm:message-digest-assembly-handler:0.9.2'
// https://jarcasting.com/artifacts/de.sfuhrm/message-digest-assembly-handler/
implementation ("de.sfuhrm:message-digest-assembly-handler:0.9.2")
'de.sfuhrm:message-digest-assembly-handler:jar:0.9.2'
<dependency org="de.sfuhrm" name="message-digest-assembly-handler" rev="0.9.2">
  <artifact name="message-digest-assembly-handler" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.sfuhrm', module='message-digest-assembly-handler', version='0.9.2')
)
libraryDependencies += "de.sfuhrm" % "message-digest-assembly-handler" % "0.9.2"
[de.sfuhrm/message-digest-assembly-handler "0.9.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.maven.plugins : maven-assembly-plugin jar 3.2.0

provided (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.6.0
org.jmockit : jmockit jar 1.49

Project Modules

There are no modules declared in this project.

Message Digest Assembly Handler

Build Status Maven Central Codacy Badge License ReleaseDate

This is a plugin for the Maven Assembly Plugin that calculates Message Digests for the files in the archive. A typical possible outcome is a MD5SUMS file or SHA256SUMS file.

Requirements

The message-digest-assembly-handler requires at least the following environment:

  • JDK 8 and later
  • Maven-Assembly-Plugin 3.2.0 and later as a plugin in your pom.xml

Setup

You need to add the handler to your pom.xml and your assembly descriptor file. Examples are shown in the next subsections.

In your POM

In your pom.xml, add the message-digest-assembly-handler as a dependency to your maven-assembly-plugin plugin as described below.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>3.2.0</version>
  <dependencies>
     <dependency>
       <groupId>de.sfuhrm</groupId>
       <artifactId>message-digest-assembly-handler</artifactId>
       <version>0.9.2</version>
     </dependency>
  </dependencies>
</plugin>

In your assembly descriptor

In your XML assembly descriptor, add one containerDescriptorHandler element:

<?xml version="1.0"?>
<assembly>
  <id>my-id</id>
  <formats>
    <format>jar</format>
  </formats>
  <containerDescriptorHandlers>
    <containerDescriptorHandler>
      <handlerName>message-digest</handlerName>
      <configuration>
        <messageDigest>MD5</messageDigest>
        <checksumFile>MD5SUMS</checksumFile>
      </configuration>
    </containerDescriptorHandler>
  </containerDescriptorHandlers>

Instead of the handlerName "message-digest" you can also directly refer to the shortcuts in the following table.

Message Digest handlerName Parameter Default checksumFile Note
MD5 * message-digest MD5SUMS * * default is MD5, overwriting is possible
MD5 message-digest-md5 MD5SUMS
SHA message-digest-sha-1 SHA1SUMS "SHA" in JDK refers to the SHA-1 algorithm
SHA-256 message-digest-sha-2-256 SHA256SUMS SHA-2
SHA-512 message-digest-sha-2-512 SHA512SUMS SHA-2

Note that overwriting the messageDigest and checksumFile is possible for every handlerName, but except the generic message-digest it will probably confuse to have a different algorithm that does not match the handler name.

Configuration

The handler declaration in the assembly descriptor understands the following configuration parameters:

  • messageDigest: The name of a MessageDigest algorithm from the JDK. Defaults to MD5. The following lists the MessageDigest algorithms supported by AdoptOpenJDK13: MD2, MD5, SHA, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256, SHA3-224, SHA3-256, SHA3-384, SHA3-512.

  • checksumFile: The name of the checksum file generated. Defaults to MD5SUMS. Typical names are MD5SUMS, SHA1SUMS, and so on.

  • exclusionRegex: A regular expression that defines what files shall not be handled by this handler. This option is important if you want to create multiple checksum files with multiple containerDescriptorHandler sections. You can then exclude the handlers from each other, for example by giving the regex (MD5SUMS|SHA1SUMS).

Versions

Version
0.9.2
0.9.1