1、建一个pom.xml文件
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.companny.maven</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <!-- 添加依赖 --> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> </dependencies> </project>
2、在该pom.xml所在目录:
cmd下:输入以下命令:
mvn dependency:copy-dependencies
3、下载完成后的jar在dependency的目录下