0

I follow the below two links to download ojdbc jar and install it locally in Windows system:

  1. Oracle JDBC ojdbc6 Jar as a Maven Dependency

  2. Maven install:install-file : specified file not exists

  3. https://www.mail-archive.com/users@maven.apache.org/msg83991.html

I end up using below command (use ` to escape -):

 mvn install:install-file `-Dfile=C:\Users\xxx\ojdbc6.jar `-DgroupId=com.oracle `-DartifactId=ojdbc6 `-Dversion=11.2.0.2.0 `-Dpackaging=jar `-DgeneratePom=true

but I am still getting below errors:

[ERROR] No plugin found for prefix '`-Dfile=C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\peter\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

Also, although it looks like by doing above, ojdbc jar is installed under .m2/repository, when I run mvn install to the project, I am still getting:

Failure to find com.oracle:ojdbc6:jar:11.2.0.2.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

How can I resolve this?

halfer
  • 19,824
  • 17
  • 99
  • 186
user1559625
  • 2,583
  • 5
  • 37
  • 75
  • Have you tried to execute `mvn` from folder where jar is located not to use full path with drive name? – Ivan Oct 26 '18 at 15:43
  • @Ivan yes, same behavior – user1559625 Oct 26 '18 at 20:18
  • Try to enter your command and specify your path to mvn: `C:\apache-maven\bin\mvn install:install-file -Dfile=C:\Users\xxx\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true`, for example. – Alexis Dufrenoy Oct 28 '18 at 10:39

1 Answers1

1

Why are you putting backquotes (`) in your command? Try to run it without backquotes.

mvn install:install-file -Dfile=C:\Users\xxx\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true
Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124
  • [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4 :install-file (default-cli) on project xcept-test: The specified file 'C:\Users\ xxx\Downloads\ojdbc6.jar' not exists -> [Help 1] – user1559625 Oct 26 '18 at 11:59
  • as explained in my 2nd link, in windows cmd window, if you do not add backtick, you will see the above error. it happens in powershell too. – user1559625 Oct 26 '18 at 12:01
  • Did you try it out without backquotes in a basic cmd? Your link only speaks of Powershell, actually... – Alexis Dufrenoy Oct 26 '18 at 12:06
  • yes. i actually tried in basic cmd, though the article said it applies for powershell. Same behavior. – user1559625 Oct 26 '18 at 20:18