如何将jar添加到本地的maven库管理起来

1、检查本地是否安装了maven

执行mvn -v

2、将要管理起来的jar放到本地的某个文件夹下,比如我的是:

E:libelasticsearch-sql-6.5.4.0.jar

3、执行命令:

mvn install:install-file -Dfile=E:libelasticsearch-sql-6.5.4.0.jar -DgroupId=org.nlpcn.local -DartifactId=elasticsearch-sql -Dversion=6.5.4.0 -Dpackaging=jar

其中:

-Dfile:         jar包位置

-DgroupId:    jar包的groupId(由你定义)

-DartifactId:  jar包的artifactId(由你定义)

-Dversion:    jar的版本(由你定义)

-Dpackaging:  打包方式,这里是jar

4、执行过程如下:

5、验证结果

查看    D:mavenmaven-repositoryorg lpcnlocalelasticsearch-sql6.5.4.0

6、pom引入

<dependency>
     <groupId>org.nlpcn.local</groupId>
     <artifactId>elasticsearch-sql</artifactId>
     <version>6.5.4.0</version>
</dependency>
原文地址:https://www.cnblogs.com/yb38156/p/13444589.html