1

I'm using Maven 3.0.3. Evidently, the Oracle JDBC drivers are not available in a public Maven repo, so I'm reduced to installing it to my local one. So I created this file

~/.m2/repository/oracle/oracle/10.2.0.3.0/classes12.jar

I have this in my pom.xml file …

<dependency>
  <groupId>oracle</groupId>
  <artifactId>classes12</artifactId>
  <version>10.2.0.3.0</version>
</dependency>

Yet upon running maven, I'm getting this error. How do I structure my local repo? - Dave

[ERROR] Failed to execute goal on project infinitiusa_leads_testing: Could not resolve dependencies for project infinitiusa_leads_testing:infinitiusa_leads_testing:jar:1.0-SNAPSHOT: Failure to find oracle:classes12:jar:10.2.0.3.0 in http://repo1.maven.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]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Dave
  • 8,667
  • 25
  • 72
  • 90

1 Answers1

2

First of all, you must install the file in the repository, not only copy it to the right directory. See the answer: Find Oracle JDBC driver in Maven repository.

Secondly, the directory is actually not right. For the dependency you provided in pom.xml it should lie in:

~/.m2/repository/oracle/classes12/10.2.0.3.0/classes12-10.2.0.3.0.jar

But this is taken care of by install:install-file, don't manipulate the repository directory manually (except deleting some stuff, maven sometimes gets confused and it needs restart, but that's a different story).

mvn install:install-file -DgroupId=oracle -DartifactId=classes12 \
 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=classes12.jar

BTW consider com.oracle as groupId.

Also maven typically gives the very exact command line you should run to install the missing dependency in your local repository. Don't know why it didn't happen in your case.

Community
  • 1
  • 1
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674