找到了一个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]
因为Oracle使用的授权协议,Maven的中央库不被允许托管其artifacts,你可以本地安装Oracle数据库,然后将安装目录中的JDBC jar包install到本地的Maven仓库,Maven命令:
上面的Maven命令会把jar文件安装到本地的Maven仓库,DgroupId和DartifactId参数分别指定安装时的groupId和artifactId,可以随便指定,但肯定最好是和jar包的版本尽量一致的,避免以后混淆。
如果不想本地安装Oracle数据库,也可以在Oracle的官网直接下载想安装的JDBC驱动版本(Google 搜索“jdbc oracle”),下面是我找到的:
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
下载之后,同样执行上面的Maven命令。
如果JDBC驱动的版本或其他方面有问题,可以看看官方的FAQ:
http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html
最后,直接通过Maven来安装Oracle JDBC驱动是可以的,但不是从Maven的中央库(中央库不提供,因为这是非法的)而是Oracle自己的Maven库下载,具体步骤可以看这个页面:
https://blogs.oracle.com/dev2dev/entry/oracle_maven_repository_instructions_for
关于Oracle驱动版本的问题,找了篇文章,写得还比较详细
http://elf8848.iteye.com/blog/811037