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. 个人知识管理系统Version1.0开发记录(10)

    物理分页 这次我们运用Mybatis拦截器来实现物理分页,后面会运用动态sql来实现,或者运用Map/CollectionUtils/StringUtils编写工具类来实现.oracle是运用的row ...

  2. js 函数对象

    函数是进行模块化程序设计的基础,编写复杂的Ajax应用程序,必须对函数有更深入的了解: javaScript中的函数不同于其他的语言,每个函数都是作为一个对象被维护和运行的,通过函数对象的性质,可以很 ...

  3. 【Matplotlib】线设置,坐标显示范围

    改变线的颜色和线宽 参考文章: controlling line properties Line API 线有很多属性你可以设置:线宽,线型,抗锯齿等等:具体请参考matplotlib.lines.L ...

  4. poj 2096 Collecting Bugs 概率dp 入门经典 难度:1

    Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 2745   Accepted: 1345 ...

  5. Python3 运算符(八)

    什么是运算符? 举个简单的例子 4 +5 = 9 . 例子中,4 和 5 被称为操作数,"+" 称为运算符. Python语言支持以下类型的运算符: 算术运算符 比较(关系)运算符 ...

  6. Javascript实现重力弹跳拖拽运动效果

    声明: By:GenialX 个人主页:胡旭博客 - www.ihuxu.com QQ:2252065614 演示地址: http://www.ihuxu.com/project/gcdmove/ 调 ...

  7. Yii在window下的安装方法

    首先,在http://www.yiichina.com/上下载yii 然后,配置系统环境变量,在win8下,按win+x,找到系统->高级系统设置->环境变量->path 把php的 ...

  8. Linux软件包安装(rpm、yum、apt-get)

    转载自:https://blog.csdn.net/wzq__janeGreen_/article/details/81774924 rpm/yum适用于Redhat.CentOS.Suse等平台: ...

  9. Codeforces 133A:HQ9+

    A. HQ9+ time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...

  10. 【spring源码学习】Spring @PostConstruct和@PreDestroy实例

    在Spring中,既可以实现InitializingBean和DisposableBean接口或在bean配置文件中指定 init-method 和 destroy-method 在初始化和销毁回调函 ...