maven命令下载jar包

mvn install:install-file -Dfile=jar包保存的本地路径 -DgroupId=jar保存的父级路径 -DartifactId=jar包文件夹名称 -Dversion=版本 -Dpackaging=jar --settings maven的setting.xml文件路径

例如:

下载alibaba的fastjson包步骤:

1.配置好maven的环境变量(具体操作百度吧)

2.打开cmd命令框输入:mvn install:install-file -Dfile=D:workfastjson-1.2.70.jar -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=1.2.70 -Dpackaging=jar --settings E:mavenconfsettings.xml

ps:我的fastjson包放在D:work下

参照下面的pom.xml配置即可

<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>fastjson</artifactId>
  <version>1.2.70</version>
</dependency>

原文地址:https://www.cnblogs.com/w-wu/p/13032509.html