java - 公共maven库中没有oracle jdbc驱动lib?
阿神
阿神 2017-04-17 17:42:12
0
2
560

找到了一个odps jdbc driver库,但是编译时出错,有人知道原因吗?

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.4.0</version>
</dependency>
    
[ERROR] Failed to execute goal on project xx: Could not resolve dependencies for projectxxx:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc14:jar:10.2.0.4.0 in http://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]
[ERROR]
阿神
阿神

闭关修行中......

reply all(2)
小葫芦

Due to the licensing agreement used by Oracle, Maven's central library is not allowed to host its artifacts. You can install the Oracle database locally, and then install the JDBC jar package in the installation directory to the local Maven repository. Maven command:

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

The above Maven command will install the jar file into the local Maven repository. The DgroupId and DartifactId parameters specify the groupId and artifactId during installation respectively. You can specify them arbitrarily, but it is definitely best to be as consistent as possible with the version of the jar package to avoid confusion in the future. .

If you don’t want to install the Oracle database locally, you can also directly download the JDBC driver version you want to install from Oracle’s official website (Google search “jdbc oracle”). Here is what I found:
http://www.oracle.com/technetwork/ database/features/jdbc/index-091264.html
After downloading, also execute the above Maven command.

If you have problems with the JDBC driver version or other aspects, you can check out the official FAQ:
http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html

Finally, it is possible to install the Oracle JDBC driver directly through Maven, but it is not downloaded from Maven's central library (the central library is not provided because it is illegal) but from Oracle's own Maven library. For specific steps, you can see this page:
https://blogs.oracle.com/dev2dev/entry/oracle_maven_repository_instructions_for

迷茫

Regarding the issue of Oracle driver version, I found an article, which is quite detailed
http://elf8848.iteye.com/blog/811037

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template