Guide to installing 3rd party JARs

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包的部署

时间: 2024-10-17 14:50:39

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

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 2016 Contents About This Guide...................................................................................... 11 Shared Topics in This Guide .

[it-ebooks]电子书列表

#### it-ebooks电子书质量不错,但搜索功能不是很好 #### 格式说明  [ ]中为年份      ||  前后是标题和副标题  #### [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/ Learning Web App Developmen

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

[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/Learning Web App Development || Build Quickly with Proven JavaScript Techniques http://

Oracle 11g Articles

发现一个比较有意思的网站,http://www.oracle-base.com/articles/11g/articles-11g.php Oracle 11g Articles Oracle Database 11g: New Features For Administrators OCP Exam Articles Oracle Database 11g Release 1: Miscellaneous Articles Oracle Database 11g Release 2: Misc

弄明白什么是Everything(文件快速搜索工具)

Everything What is "Everything"? How long will it take to index my files? Does Everything search file contents? Does "Everything" hog my system resources? Does "Everything" monitor file system changes? Is "Everything&quo

windows ntp安装及调试

Setting up NTP on Windows It's very helpful that Meinberg have provided an installer for the highly-respected and high-accurate NTP software for Windows users - my thanks to them.  This Web page provides a quick guide to installing NTP on Windows XP,

samba温故知新

SAMBA服务器可以实现Windows主机和Linux主机共享资源互访的功能,即在Windows下可以通过网上邻居访问Linux操作系统中SAMBA服务器共享的文件夹,当然,Linux操作系统之间同样可以使用SAMBA互相访问共享资源. linux共享文件到Window 00.安装samba yum install -y samba samba-client 01.创建共享目录 mkdir /share 02.添加smb认证账户useradd -s /sbin/nologin mvpsmbpas

Genymotion无法运行arm程序的问题

解决办法: 点击下载Genymotion-ARM-Translation.zip 将你的虚拟器运行起来,将下载好的zip包用鼠标拖到虚拟机窗口中,出现确认对跨框点OK就行.然后重启你的虚拟机. 不过在实际操作的过程中,发现在部分模拟器环境下,将zip文件拖进去以后会报错,提示"an error occurred while deploying a file".经过实验,用DDMS也没法手动安装zip包里的东西(要复制到system下).个人认为原因可能在于设备没有在root的状态下,但

Install jar manually into maven and Nexus

Sometimes the maven building just needs one or more 3rd party jars, and the jars cannot be downloaded and installed automatically by Internet. Then you can install these jars manually. 1st. Install a 3rd party jar package into maven repositor mvn ins