将环境中jar包拿到本地,通过命令安装到本地maven中去
针对IDEA中下载某些jar速度太慢 命令示例 mvn install:install-file -DgroupId=shade.org.apache.parquet -DartifactId=parquet-format -Dversion=1.10.2-SNAPSHOT -Dpackaging=jar -Dfile=E:libparquet-format-2.4.0.jar
演示示例:
1、hive-exec-2.1.1-cdh6.3.2.jar需要从系统环境上拉取该jar包(我这的资源jar的路径/opt/cloudera/parcels/CDH/jars) 2、将jar包拉取到C:UserszhangwenDesktop目录下(这里是我个人目录) 3、到maven官网:https://mvnrepository.com/ 搜索想要的jar包名
搜索到相应的pom依赖文件:
将pom依赖文件粘贴过来:org.apache.hive hive-exec2.1.1-cdh6.3.3
~
4、按照例子进行改写命令: mvn install:install-file -DgroupId=org.apache.hive -DartifactId=hive-exec -Dversion=2.1.1-cdh6.3.3 -Dpackaging=jar -Dfile=C:UserszhangwenDesktopmvninstallhive-exec-2.1.1-cdh6.3.2.jar 需要该的三个地方: (1) -DgroupId 与org.apache.hive 中的org.apache.hive相对应 (2)-DartifactId 与hive-exec中的hive-exec相对应 (3)-Dversion 与2.1.1-cdh6.3.3 中的2.1.1-cdh6.3.3相对应 (4)-Dfile 是把系统上拉取的jar包存放的位置以及jar包的名称 C:UserszhangwenDesktopmvninstallhive-exec-2.1.1-cdh6.3.2.jar
~
5、 win 本地 win+r 然后 cmd 进入黑窗口: 输入该命令即可: mvn install:install-file -DgroupId=org.apache.hive -DartifactId=hive-exec -Dversion=2.1.1-cdh6.3.3 -Dpackaging=jar -Dfile=C:UserszhangwenDesktopmvninstallhive-exec-2.1.1-cdh6.3.2.jar 执行成功后下面这个样子
具体执行命令:
操作:直接在cmd中执行上面命令 C:Userszhangwen>mvn install:install-file -DgroupId=shade.org.apache.hive -DartifactId=hive-exec -Dversion=2.1.1-cdh6.3.2 -Dpackaging=jar -Dfile=C:UserszhangwenDesktopmvninstallhive-exec-2.1.1-cdh6.3.2.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:UserszhangwenDesktopmvninstallhive-exec-2.1.1-cdh6.3.2.jar to D:toolsmaveninstall_filerepositoryshadeorgapachehivehive-exec2.1.1-cdh6.3.2hive-exec-2.1.1-cdh6.3.2.jar [INFO] Installing C:UserszhangwenAppDataLocalTempmvninstall523721195914973015.pom to D:toolsmaveninstall_filerepositoryshadeorgapachehivehive-exec2.1.1-cdh6.3.2hive-exec-2.1.1-cdh6.3.2.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.781 s [INFO] Finished at: 2021-12-20T16:56:38+08:00 [INFO] ------------------------------------------------------------------------
6、在maven project 进行clear一下,再compile进行重新编译。



