title: Oracle JDBC ojdbc6 Jar as a Maven Dependency
body: <p>I cannot seem to get Maven to bundle the ojdbc6.jar file into my project's war file.  I have it working within the POM file when specifying a dependency directly for Hibernate tools.  But it won't get bundled with the project's war file, and therefore my project won't run on Tomcat.</p>
  
  <p>I have tried every solution I can find out there on the net, including those specified for this question here:</p>
  
  <p><a href="https://stackoverflow.com/questions/1074869/find-oracle-jdbc-driver-in-maven-repository">Find Oracle JDBC driver in Maven repository</a></p>
  
  <p>Most recently, I did the following:</p>
  
  <ol>
  <li><p>Download the jar file to my machine</p></li>
  <li><p>Run the following command to install the jar into my local repository:</p>
  
  <pre><code>mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true
  </code></pre>
  
  <p>(I've tried all kinds of variants of that command, too.)</p></li>
  <li><p>Finally, I put the dependency into my pom file:</p>
  
  <pre><code>&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;
  </code></pre></li>
  <li><p>I run a clean build, but it fails:</p>
  
  <pre><code>mvn -U clean package
  
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building jazztwo 0.0.1
  [INFO] ------------------------------------------------------------------------
  Downloading: http://repo1.maven.org/maven2/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 0.700s
  [INFO] Finished at: Tue Mar 27 15:06:14 PDT 2012
  [INFO] Final Memory: 3M/81M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal on project jazztwo: Could not resolve dependencies for project edu.berkeley:jazztwo:war:0.0.1: Could not find artifact com.oracle:ojdbc6:jar:11.2.0.3 in central (http://repo1.maven.org/maven2) -&gt; [Help 1]
  </code></pre></li>
  </ol>
  
  <p>Why doesn't this work?  I'm ready to throw expensive computer parts across the room.  This has wasted so much time. (Thank you, Oracle.  How much did we pay you again?)  </p>
  
  <p>Is it because I'm on a Mac, perhaps?</p>