2

I have created a project in Eclipse using maven. I am getting an error in my pom.xml in dependency, the dependency look like this.

<dependency> 
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc5</artifactId>
    <version>11.2.0.1</version>
    <scope>provided</scope>
</dependency>

I am getting:

Missing artifact com.oracle:ojdbc5:jar:11.2.0.1

I saw a solution in stackoverflow it self, That-

due to Oracle license restriction, there are no public repositories that provide ojdbc jar. you need to download it and install in your local repository. Get jar from Oracle and install it in your local maven repository using

mvn install:install-file -Dfile={path/to/your/ojdbc.jar} -DgroupId=com.oracle 
-DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

the above command. I executed the bellow command changing the path to my ojdbc.jar.

mvn install:install-file -Dfile={
C/monitoring-workspace/ojdbc5.jar} -DgroupId=com.oracle 
-DartifactId=ojdbc5 -Dversion=11.2.0.1-Dpackaging=jar

but I am getting an error on cmd that enter image description here

I am confused in two things

  • My oracle folder it self has ojdbc5 and ojdbc6 jar then why do I need to install ojdbc5

  • What should be the path I need to provide while installing ojdbc-the where I need to install or the path where I have kept ojdbc5 jar.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Varun
  • 4,342
  • 19
  • 84
  • 119
  • 2
    Three things here (at least): 1) remove the "{". 2) When copy-pasting, do not include new line in your command. 3) Path should at least include _C:/_ instead of _C/_. – Tome Apr 17 '15 at 08:14
  • possible duplicate of [Find Oracle JDBC driver in Maven repository](http://stackoverflow.com/questions/1074869/find-oracle-jdbc-driver-in-maven-repository) – Joe Apr 17 '15 at 12:12

2 Answers2

2

I see you have referred to mykong article. The problem is new lines. You have to make sure that you got it in one line in the command prompt.

mvn install:install-file -Dfile=C:/monitoring-workspace/ojdbc5.jar -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.1 -Dpackaging=jar
TV Nath
  • 499
  • 5
  • 12
  • 35
  • after executing the above command I am getting [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- [ERROR] The specified file 'C:\monitoring-workspace\ojdbc5.jar' not exists [INFO] [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.260 s [INFO] Finished at: 2015-04-17T14:34:11+05:30 [INFO] Final Memory: 9M/152M [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on p – Varun Apr 17 '15 at 09:09
  • -Dfile= do ineed to provide my workspace path?? or the path of the jar file. please reply – Varun Apr 17 '15 at 09:15
  • I am sorry for the delay in the reply. you should provide the path to the ojdbc jar – TV Nath Apr 19 '15 at 14:16
  • 1
    and also consider using ojdbc6, instead of 5 if there is no particular reason to use 5 – TV Nath Apr 19 '15 at 14:16
1

ojdbc6.jar - Classes for use with JDK 1.6. or newer
ojdbc5.jar - Classes for use with JDK 1.5.
you need only one of them

Igor Kudryashov
  • 353
  • 2
  • 10