Although rarely, but sometimes you will have 3rd party JARs that you need to put in your local repository for use in your builds, since they don't exist in any public repository like Maven Central. The JARs must be placed in the local repository in the correct place in order for it to be correctly picked up by Apache Maven. To make this easier, and less error prone, we have provide a goal in the maven-install-plugin which should make this relatively painless. To install a JAR in the local repository use the following command:

    mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

If there's a pom-file as well, you can install it with the following command:

    mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>

With version 2.5 of the maven-install-plugin it gets even better. If the JAR was built by Apache Maven, it'll contain a pom.xml in a subfolder of the META-INF directory, which will be read by default. In that case, all you need to do is:

    mvn install:install-file -Dfile=<path-to-file>

由于oracle商业版权问题,maven不能通过中心资源库直接下载jar包,如果想要使用jar包,需要手动处理。
第一步:将ojdbc6.jar放到任意目录下,例如:D:\download\oracle11g驱动jar包
第二步:(需配置及安装maven,可通过mvn -version验证是否安装)在cmd命令中执行

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jar -Dfile=D:\download\ojdbc6.jar

这样就将jdbc驱动安装到maven的本地资源库中,进入maven本地资源库:D:\Maven\localRepository,可以看到已经将ojdbc6.jar打包到本地资源库中。

第三步:在所需要的工程中的pom.xml中添加dependency

        <dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>

即完成了maven  jar包的部署

Guide to installing 3rd party JARs的更多相关文章

  1. Maven 安装依赖包

    Guide to installing 3rd party JARs Although rarely, but sometimes you will have 3rd party JARs that ...

  2. Spring Boot Reference Guide

    Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch,  ...

  3. Tomcat Clustering - A Step By Step Guide --转载

    Tomcat Clustering - A Step By Step Guide Apache Tomcat is a great performer on its own, but if you'r ...

  4. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  5. Installing FIM 2010 R2 SP1 Portal on SharePoint Foundation 2013

    http://www.fimspecialist.com/fim-portal/installing-fim-2010-r2-sp1-portal-on-sharepoint-foundation-2 ...

  6. 【转】Installing OpenCV on Debian Linux

    In this post I will describe the process of installing OpenCV(both versions 2.4.2 and 2.4.3) on Debi ...

  7. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  8. samba完美安装

    感觉是一个相当强大的东西. Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件.它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务.为客户机/服务器型协议,客户机通过该协议 ...

  9. 如何使用Unix/Linux grep命令——磨刀不误砍柴工系列

     http://man.linuxde.net/grep ---------------------------------------------------- 如何使用Unix/Linux gre ...

随机推荐

  1. 初识webservice 服务

    1.获取电话号码归属地查询 首先访问: http://www.webxml.com.cn/zh_cn/web_services.aspx ①新建一个MyEclipse项目(WebService) ht ...

  2. ArcGIS 10 Raster Calculator 在哪儿

    ArcGIS 10 Raster Calculator 在哪儿? 现在大家用的最多的是ArcGIS9.3,所以大家都知道Raster Calculator在ArcToolbox->Spatial ...

  3. 配置java环境变量,实现一条命令自由切java7 或java8

    在多个java编译环境中,有时需要java 7,有时又需要java 8,怎么配置java 环境,可以快速自动切换呢?下面用mac演示在 /etc/bashrc 中配置的环境变量 # 设置 JDK ex ...

  4. [置顶] VS 2017 众多重构插件

    孙广东  2017.7.22 http://blog.csdn.NET/u010019717 1.没有任何插件的情况下:  (就是Ctrl + .)   注意:这个.  要是英文的才行! 右键菜单也是 ...

  5. 第9课 函数重载分析(下)与C、C++相互调用

    重载与指针 下面的函数指针将保存哪个函数的地址: 在给p赋值的时候,我们使用了func,但是这里并没有指明参数,编译器是怎么知道这个func函数指的是第一个func函数呢? 函数重载遇上指针: 将重载 ...

  6. self-taught learning setting && semi-supervised learning

    参考文献: 摘于上文献: The more general and powerful setting is the self-taught learning setting, which does n ...

  7. HDU - 4676 :Sum Of Gcd (莫队&区间gcd公式)

    Given you a sequence of number a 1, a 2, ..., a n, which is a permutation of 1...n. You need to answ ...

  8. python3 随机生成UserAgent

    安装库 pip install fake_useragent #引入 from fake_useragent import UserAgent; ua = UserAgent(); print(ua. ...

  9. 《DSP using MATLAB》Problem 3.2

    1.用x1序列的DTFT来表示x2序列的DTFT 2.代码: %% ------------------------------------------------------------------ ...

  10. 在服务器上运行db:seed数据填充时,出错的问题解决

    在服务器上运行db:seed数据填充时,出错的问题解决 运行composer  dump-autoload