title: Maven-Shade MySQL classnotfound
body: <p>I'm trying to use Maven Shade to build an Uber Jar. Everything is working, it builds makes the uber jar, which I'm running from a BAT file: non database stuff runs fine, but for some reason, MySQL-Connector is not being found on the classpath.</p>
  
  <pre><code>2014-09-08 17:14:00 DEBUG DatabaseConnectionFactory:47 - Creating a new database connection
  2014-09-08 17:14:00 ERROR DatabaseConnectionFactory:53 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/myDB?user=root&amp;password=
  </code></pre>
  
  <p>The maven plugins are located in my parent POM, and the dependencies are in the child poms, ( though I've tried putting the plugins in the DB module POM too, to no avail.)</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;5.1.32&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>In seeking a solution, I've adding -cp to the downloaded jar on the command line, but I can't get the connector found! The whole program works in my IDE fine, no issues.</p>
  
  <p>I've read a couple of other posts involving Shade, from which I never found a clear enough ( clear enough for me ( no comments please) answer!) The answers usually stipulated using assembly plugin. However, I'd like to stick with Shade as it makes everything simple.</p>
  
  <p>I've added a cut down POM below, and am hoping someone can help me out!</p>
  
  <p>Many thanks!</p>
  
  <pre><code>               &lt;execution&gt;
                      &lt;id&gt;myClient&lt;/id&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;outputFile&gt;C:\Dev\myJar.jar&lt;/outputFile&gt;
                          &lt;transformers&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                  &lt;mainClass&gt;myapp.ClientStart&lt;/mainClass&gt;
                              &lt;/transformer&gt;
                          &lt;/transformers&gt;
  
                          &lt;filters&gt;
                              &lt;filter&gt;
                                  &lt;artifact&gt;*:*&lt;/artifact&gt;
                                  &lt;excludes&gt;
                                      &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                                      &lt;exclude&gt;properties/**&lt;/exclude&gt;
                                      &lt;exclude&gt;images/**&lt;/exclude&gt;
                                  &lt;/excludes&gt;
                              &lt;/filter&gt;
                          &lt;/filters&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
  </code></pre>