使用 mvn 单独下载某个依赖

https://stackoverflow.com/questions/1895492/how-can-i-download-a-specific-maven-artifact-in-one-command-line

例如,某个依赖在 pom 文件中是这样的:

1
2
3
4
5
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.6.2</version>
</dependency>

那么使用 mvn 单独下载这个依赖:

1
2
3
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
-DrepoUrl=https://mvnrepository.com/artifact/
-Dartifact=redis.clients:jedis:2.6.2