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

前端 未结 11 871
太阳男子
太阳男子 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:25

    Here's what worked for me to download the latest version of an artifact called "component.jar" with Maven 3.1.1 in the end (other suggestions did not, mostly due to maven version changes I believe)

    This actually downloads the file and copies it into the local working directory

    From bash:

    mvn dependency:get \
        -DrepoUrl=http://.../ \
            -Dartifact=com.foo.something:component:LATEST:jar \
            -Dtransitive=false \
            -Ddest=component.jar \
    

提交回复
热议问题