Giter VIP home page Giter VIP logo

message-digest-assembly-handler's Introduction

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).

message-digest-assembly-handler's People

Contributors

sfuhrm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.