1.新建文件夹temp,在temp下新建setup.bat ,pom.xml
2.编辑setup.bat 和pom.xml
bsetup.bat
call mvn -f pom.xml dependency:copy-dependencies @pause
配置需要下载的依赖到pom.xml
<?xml version="1.0"?> <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>temp.download</groupId> <artifactId>temp-download</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <!-- 需要下载什么jar包 添加相应依赖 其余部分无需在意--> <dependency> <groupId>org.jasig.cas</groupId> <artifactId>cas-client-core</artifactId> <version>3.1.10</version> </dependency> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.58</version> </dependency> </dependencies> </project>
3.运行bat等待自己结束
4。结束后会在temp下生成target/denpendency目录,需要的jar包会下载在此处
原文:https://www.cnblogs.com/SunshineKimi/p/11296923.html