maven本地jar包导入

今天用到第三方一个库,在spark中将数据导入到hbase,使用了shc-core,但将maven配置上去无法下载,那只能另找方法了。先从https://mvnrepository.com/artifact/com.hortonworks/shc-core/1.1.1-2.1-s_2.11好面将jar包下载下来,开始想在maven的仓库中手动配置目录结构的,在google上查了下结果发现有更加简单的方法,即是下面所述的方法。

1、先下载个maven安装包--http://maven.apache.org/

2、配置环境变量:

3、根据https://mvnrepository.com/artifact/com.hortonworks/shc-core/1.1.1-2.1-s_2.11配置,编写好maven的命令,如下:

<!-- https://mvnrepository.com/artifact/com.hortonworks/shc-core -->

<dependency>

<groupId>com.hortonworks</groupId>

<artifactId>shc-core</artifactId>

<version>1.1.1-2.1-s_2.11</version>

</dependency>

4、执行命令: 

C:\Users\linxiaojie>mvn install:install-file -Dfile=C:\Users\linxiaojie\Downloads\shc-core-1.1.1-2.1-s_2.11.jar -DgroupId=com.hortonworks -DartifactId=shc-core -Dversion=1.1.1-2.1-s_2.11 -Dpackaging=jar

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------< org.apache.maven:standalone-pom >-------------------

[INFO] Building Maven Stub Project (No POM) 1

[INFO] --------------------------------[ pom ]---------------------------------

[INFO]

[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---

[INFO] Installing C:\Users\linxiaojie\Downloads\shc-core-1.1.1-2.1-s_2.11.jar to C:\Users\linxiaojie\.m2\repository\com\hortonworks\shc-core\1.1.1-2.1-s_2.11\shc-core-1.1.1-2.1-s_2.11.jar

[INFO] Installing C:\Users\LINXIA~1\AppData\Local\Temp\mvninstall8183451439892569614.pom to C:\Users\linxiaojie\.m2\repository\com\hortonworks\shc-core\1.1.1-2.1-s_2.11\shc-core-1.1.1-2.1-s_2.11.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 0.584 s

[INFO] Finished at: 2018-08-13T14:29:25+08:00

[INFO] ------------------------------------------------------------------------

 5、确认本地仓库生成成功

猜你喜欢

转载自blog.csdn.net/goodstudy168/article/details/81629602