maven添加oracle jar包-解决

因为授权问题,maven是无法直接通过依赖下载oracle jar包的,所以需要手动导入jar包。

  1. 下载相关ojdbc.jar相应版本,官网直接下载
  2. 打开ojdbc.jar 查看对应版本号META-INF ,如:Specification-Version:  Oracle JDBC Driver version - "10.2.0.3.0"
  3. 执行mvn命令 已经下载安装成功了。
    mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc14.jar --X help:effective-pom

     

           


PS:安装过程中会遇到几种报错:

#1.Goal requires a project to execute but there is no POM in this directory...., Goal requires a project to execute but there is no POM in this directory (C:\Users\hxl). Please verify you invoked Maven from the correct directory.

解决:这是有些jar包依赖需要配pom文件,直接按照你的jar 包版本,写一个pom文件

#2.No plugin found for prefix 'install' in the current project and in the p lugin groups [org.apache.maven.plugins, org.codehaus.mojo]

解决:这种是由于有些plugins下载不到报错了,直接更换阿里云mvn镜像链接即可。

另外安装过程一定加上mvn -X命令可以显示更多报错信息出来

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章