title: How can I create one checksum of two files in Maven to use it in the name of a directory
body: <p>I'm creating a directory (local Eclipse b3 Aggregator/P2 mirror) with Maven.</p>
  
  <p>Two configuration files (A.target, B.target) are used two create this directory.</p>
  
  <p>If these configuration files change a new mirror directory should be created.</p>
  
  <p>I want to add the checksum of the configuration files to the name of the mirror directory (e.g. mirror_65eb5293d29682a3414e8889a84104ee).</p>
  
  <p>I could use the 'maven-assembly-plugin' to create a jar containing the configuration files but how do I create the checksum of this jar?</p>
  
  <p>The 'checksum-maven-plugin' only writes the checksum into a csv file which I would have to parse somehow.</p>
  
  <p>Is there a way to create the checksum into a property so that I can use it to add it to the name of the directory?</p>
  
  <p>UPDATE:</p>
  
  <p>My solution for now is to use a shell script to create the checksum and write it to a properties file.</p>
  
  <pre class="lang-sh prettyprint-override"><code>#!/bin/bash
  
  os=$(uname)
  
  if [[ "$os" == "Linux" ]];
    then
    checksum=$(cat {A,B}.target | md5sum | awk '{print $1}')
  elif [[ "$os" == "Darwin" ]]; then
    checksum=$(cat {A,B}.target | md5 -q)
  else
    echo "unknown OS ${os}"
    exit 1
  fi
  
  printf "checksum=%s" "${checksum}" &gt; ./checksum.properties
  </code></pre>
  
  <p>Then I can use the <em>properties-maven-plugin</em> to read the checksum from this properties file.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    &lt;artifactId&gt;properties-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;1.0-alpha-2&lt;/version&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;phase&gt;initialize&lt;/phase&gt;
        &lt;goals&gt;
          &lt;goal&gt;read-project-properties&lt;/goal&gt;
        &lt;/goals&gt;
        &lt;configuration&gt;
          &lt;files&gt;
            &lt;file&gt;./checksum.properties&lt;/file&gt;
          &lt;/files&gt;
        &lt;/configuration&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>