title: No suitable driver found when including the needed drivers with maven-assembly-plugin
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5130254/java-error-no-suitable-driver-found">java error (No suitable driver found)</a>  </p>
  </blockquote>
  
  
  
  <p>I have a very small too that works with a PostgreSQL DB and it would be very convenient to use it as a single jar. So indeed I've tried using the maven-assembly-plugin like so: </p>
  
  <pre><code>&lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;pack.name.MainClass&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;
  </code></pre>
  
  <p>And it works perfectly fine, I can see all the files I require added to the jar file, including the driver's files but when I'm trying to run it I get a:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:postgresql://&lt;ip&gt;:5432/dbname
  </code></pre>
  
  <p>I have this:</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.oracle&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
              &lt;version&gt;11.2.0.3&lt;/version&gt;
          &lt;/dependency&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;9.1-901-1.jdbc4&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>In the dependencies and the URL is exactly as I wrote above (except the censored address :) ).
  What am I missing?</p>
  
  <p>Thanks!</p>