title: Maven corrupting binary files in src/main/resources when building jar
body: <p>I've got an issue with a maven project where I am distributing dlls from the src/main/resources/lib folder. </p>
  
  <p>The project is built as a single jar with dependencies using the maven-assembly-plugin. </p>
  
  <p>Unfortunately, the maven process is corrupting my dll libraries during the copy process so that they are no longer useful to the application.</p>
  
  <p>I've had a look at such concepts as resource filtering. </p>
  
  <p>Here's my relevant pom.xml</p>
  
  <p>Does anyone have any ideas? </p>
  
  <p>I think I need to do something like this but so far it's not working for me. </p>
  
  <pre><code>            &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
  
                      &lt;resources&gt;
                          &lt;resource&gt;
                              &lt;directory&gt;${basedir}/src/main/resources/lib&lt;/directory&gt;
                              &lt;filtering&gt;false&lt;/filtering&gt;
                          &lt;/resource&gt;
                      &lt;/resources&gt;
  
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;de.bochumuniruhr.psy.bio.behaviourcoder.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>My final solution (based on the answers below):</strong> </p>
  
  <p>Thank you for the great answers. I ended up going with the answer that doesn't require extending the configuration of the maven-resources-plugin. I placed my binary files in the <code>src/main/resources/unfiltered-resources</code> folder as I needed to filter my other resources. </p>
  
  <p>Here is a link to the <a href="https://github.com/johndeverall/BehaviourCoder" rel="noreferrer">source code</a>.</p>
  
  <p>Below is my final working pom at the time of writing. </p>
  
  <pre><code>&lt;build&gt;
          &lt;finalName&gt;BehaviourCoder_${git.build.time}_${git.commit.id.describe-short}&lt;/finalName&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/src/main/unfiltered-resources&lt;/directory&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;pl.project13.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;git-commit-id-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.2.2&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;revision&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;generateGitPropertiesFile&gt;true&lt;/generateGitPropertiesFile&gt;
                      &lt;injectAllReactorProjects&gt;true&lt;/injectAllReactorProjects&gt;
                      &lt;dateFormat&gt;yyyy-MM-dd_HHmmss&lt;/dateFormat&gt;
                      &lt;dateFormatTimeZone&gt;UTC&lt;/dateFormatTimeZone&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${java.version}&lt;/source&gt;
                      &lt;target&gt;${java.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;de.bochumuniruhr.psy.bio.behaviourcoder.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>