title: How to include test classes in Jar created by maven-shade-plugin?
body: <p>I'm trying to package my test classes in to an executable jar with dependencies using Maven, but I'm struggling to get this right.</p>
  
  <p>This is my pom.xml so far:</p>
  
  <pre><code>&lt;project&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.c0deattack&lt;/groupId&gt;
      &lt;artifactId&gt;executable-tests&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;executable-tests&lt;/name&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;info.cukes&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
              &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;info.cukes&lt;/groupId&gt;
              &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
              &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;2.21.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.10&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;test-jar&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.6&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;finalName&gt;cucumber-tests&lt;/finalName&gt;
                              &lt;transformers&gt;
                                  &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                      &lt;mainClass&gt;cucumber.cli.Main&lt;/mainClass&gt;
                                  &lt;/transformer&gt;
                              &lt;/transformers&gt;
                              &lt;artifactSet&gt;
                                  &lt;includes&gt;
                                      &lt;include&gt;info.cukes:*&lt;/include&gt;
                                  &lt;/includes&gt;
                              &lt;/artifactSet&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;com.c0deattack&lt;/groupId&gt;
                          &lt;artifactId&gt;executable-tests&lt;/artifactId&gt;
                          &lt;version&gt;1.0&lt;/version&gt;
                          &lt;type&gt;test-jar&lt;/type&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>When I execute <code>mvn clean package</code> the build creates 3 jars:</p>
  
  <ul>
  <li>executable-tests-1.0.jar // built by the mvn package phase</li>
  <li>executable-tests-1.0-teststjar // built by the jar-plugin</li>
  <li>cucumber-tests.jar // build by the shade-plugin</li>
  </ul>
  
  <p><code>Cucumber-tests.jar</code> contains the <code>info.cuke</code> dependencies but it doesn't contain the <code>executable-tests-1.0-tests.jar</code>.</p>
  
  <p>I've done all sorts of things to try and have the test classes included but nothing has worked, what am I missing?</p>
  
  <p><strong>Edit:</strong> I've pushed my example project to GitHub if any one fancies playing around with it :) <a href="https://github.com/C0deAttack/ExecutableTests" rel="noreferrer">https://github.com/C0deAttack/ExecutableTests</a></p>