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.
I have tried every solution I can find out there on the net, including those specified for this question here:
Find Oracle JDBC driver in Maven repository
Most recently, I did the following:
Download the jar file to my machine
Run the following command to install the jar into my local repository:
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true
(I've tried all kinds of variants of that command, too.)
Finally, I put the dependency into my pom file:
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.3</version> </dependency>
I run a clean build, but it fails:
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) -> [Help 1]
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?)
Is it because I'm on a Mac, perhaps?
ojdbc6-11.2.0.3.jar
is available in your local repository at the correct folder? – Zetlandmvn install:install-file
has not worked. You should give absolute location ofojdbc6.jar
or run the command from the folder that contains it. The file name is not a problem. You could run with a-X
flag so that you can debug info. – Zetlandinstall-file
? Maven should tell you where it installs the file to or whether there were any errors. – Pasadis