How can I download a specific Maven artifact in one command line?

前端 未结 11 949
太阳男子
太阳男子 2020-11-28 01:05

I can install an artifact by install:install-file, but how can I download an artifact?

For example:

mvn download:download-file -Dgroup         


        
11条回答
  •  时光说笑
    2020-11-28 01:29

    Here's an example to get ASM-7 using Maven 3.6:

    mvn dependency:get -DremoteRepositories=maven.apache.org -Dartifact=org.ow2.asm:7.0:sources:jar
    

    Or you can download the jar from here: https://search.maven.org/search?q=g:org.ow2.asm%20AND%20a:asm and then

    mvn install:install-file -DgroupId=org.ow2.asm -DartifactId=asm -Dversion=7.0 -Dclassifier=sources -Dpackaging=jar -Dfile=/path/to/asm-7.0.jar
    

提交回复
热议问题