Apache Maven是一个项目管理及自动构建工具,有APache软件基金会提供。我们只要配置成功后就可以通过配置pom.xml添加所需依赖的jar包和类库,因为这些类库已经在我们配置的Maven仓库中了,那么我们如何将自己开发的类库添加到我们已配置Maven仓库中呢?下面以poi的jar包为例简要说明:

1.进入poi-3.9-20121203.jar所在的目录,我的目录在C:\Users\admin\Desktop\poi

2.在该目录下新建pom.xml文件,内容如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<packaging>jar</packaging> <name>poi</name>
<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

3.打开Windows命令行窗口,进入C:\Users\admin\Desktop\poi目录下,如下图

mvn install:install-file             --mvn命令
-Dfile=poi-3.9-20121203.jar  --要添加的包
-DgroupId=poi         --pom文件对应的groupId

-DartifactId=poi        --pom文件对应得artifactId
-Dversion=3.9         --添加包的版本
-Dpackaging=jar

Maven手动增加依赖jar到本地Maven仓库中的更多相关文章

  1. maven无法下载依赖jar包—几种仓库的区别

    一.问题背景 最近这两天,感觉自己智商急剧退化,到了自己都捉急的地步,呃,有必要记录下来,以后智商被人甩几条街的时候,看看这篇文字,找找灵感也是好的! 这个项目呢,是用IDEA开发的,我一切都弄好了, ...

  2. maven手动增加jar文件

    maven手动增加jar文件 在cmd界面输入: mvn install:install-file -Dfile=D:\com.ibm.mq.jar -DgroupId=com.ibm.mq -Dar ...

  3. eclipse导入maven项目后依赖jar包更新问题->update project按钮

    eclipse导入maven项目后依赖jar包更新问题 1.eclipse有专门的导入maven项目按钮,file-import-maven project,eclipse会自动查找指定路径下的pom ...

  4. IDAE 将外部jar打入本地maven仓库

    方式1:dependency 本地jar包 <dependency> <groupId>com.hope.cloud</groupId> <!--自定义--& ...

  5. Maven下载项目依赖jar包和使用方法

    一.Maven3.5.0安装与配置+Eclipse应用 参考:Maven3.5.0安装与配置+Eclipse应用 二.http://mvnrepository.com/ 此处以http://mvnre ...

  6. jar导入本地maven库

    最近在了解视频监控相关sdk,海康威视官方sdk要求自己手工将fas-data-sdk-1.0-SNAPSHOT.jar导入本地maven库,maven配置文件pom.xml配置如下 <?xml ...

  7. Maven 将jar导入本地maven仓库

    目录 环境变量配置maven 执行一下命令即可 诚邀访问我的个人博客:我在马路边 更好的阅读体验点击查看原文:Maven将jar倒入本地maven仓库 原创博客,转载请注明出处 @ 在Java项目开发 ...

  8. 如何将本地git仓库中的代码上传到github

    1,  在github上新建一个仓库,比如为:CSS3Test,仓库地址为:https://github.com/hyuanyuanlisiwei/CSS3Test 2,本地git仓库中的文件项目为C ...

  9. (转)如何将本地git仓库中的代码上传到github

    1,  在github上新建一个仓库,比如为:CSS3Test,仓库地址为:https://github.com/hyuanyuanlisiwei/CSS3Test 2,本地git仓库中的文件项目为C ...

随机推荐

  1. MongoDB的一些用法(转藏)

    MongoDB是目前工作中经常使用到的NoSQL数据库. 本博客只记录相关理论知识和技巧,涉及到实践的部分都会单开Blog来记录实践过程. ------------------------------ ...

  2. Introduction to SharePoint hierarchy

    /* Author: Jiangong SUN */ I've participated in a SharePoint 2010 project to build an intranet. Base ...

  3. 实战 ASP.NET MVC Web API

    实战 ASP.NET MVC Web API Web API 框架基于 ASP.NET MVC 框架开发,是一个面向 Http 协议的通信框架.相对于 WCF 而言,Web API 只面向于 Http ...

  4. mosquitto awareness when before it's being compiling, and you do settings and testing

    Mostly, this clearify the usage of   ' mosquitto.conf ' in easy-understanding language.   1. compile ...

  5. TCP/IP capture/analysis tools in Unix/Linux

    There are some useful tools in Unix/Linux to check out how the system is going on. Here is a short s ...

  6. tastypie Django REST API developement 1)

    Read by linux/GNU commands Let's follow and start from here:http://django-tastypie.readthedocs.org/e ...

  7. Arduino 各种模块篇 震动模块 vibrator module

    The vibrator I got works at the voltage ranging from 3.3V ~ 5.5V I want to make it vibrate variably. ...

  8. create OpenVPN on ubuntu12.04

    ---恢复内容开始--- 最近比较火的有digitalocean  的SSD VPS,配置还不错.每个月5刀,512MB内存,CPU被虚拟过.不是KVM.链接能量也不大. 节点在西雅图,对环太平洋比较 ...

  9. hdu1205(类似 分布垃圾数列)

    Problem Description A Fibonacci sequence is calculated by adding the previous two members the sequen ...

  10. 遭遇ORA-01078,LRM-00109,ORA-27046 SPFILE文件损坏

    今天在启动数据库时遭遇到 $ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 16 21:28:03 ...