How do I download a Maven artifact at the command line without using dependency:get or maven-download-plugin?

前端 未结 5 1576
温柔的废话
温柔的废话 2020-12-24 06:18

I\'d like to download an artifact and its dependencies at the command line. I.e.

mvn [some plugin]:[goal] -DartifactId=[artifactId] -DgroupId=[groupId] -Dver         


        
5条回答
  •  执念已碎
    2020-12-24 06:52

    Example to download version 6.9.4 of TestNG to your local ~/.m2/repository (uses maven-dependency-plugin:get):

    mvn org.apache.maven.plugins:maven-dependency-plugin:RELEASE:get \
    -Dartifact=org.testng:testng:6.9.4:jar
    

    Example to download version 4.11 of JUnit to your current working directory (uses maven-dependency-plugin:copy):

    mvn org.apache.maven.plugins:maven-dependency-plugin:RELEASE:copy \
    -Dartifact=junit:junit:4.11:jar
    

提交回复
热议问题