添加本地的jar到maven的库中

window下添加本地的jar到maven库中,需要电脑上已经搭建好maven环境。

1、运行命令行

2、输入mvn install:install-file -DgroupId=taobao -DartifactId=sc

hema -Dversion=1.2.1 -Dpackaging=jar -Dfile=d:\jar\top-schema-1.2.1.jar

3、配置项目中的pom.xml,增加以下节点

<dependency>
      <groupId>taobao</groupId>
      <artifactId>schema</artifactId>
      <version>1.2.1</version>
</dependency>

 

 

注意:如果你保存pom.xml之后,冒红线了,请注意你是否自定义了maven库的位置。检查一下你的默认maven路径下是否有你的jar文件(C:\Users\你的电脑用户名\.m2\repository\你的groupid\你的artifactId\你的venrsion\)

posted @ 2016-08-10 11:53  粗人-  阅读(155)  评论(0编辑  收藏  举报