Simplest Ivy code to programmatically retrieve dependency from Maven Central

前端 未结 2 1769
我在风中等你
我在风中等你 2020-12-11 04:50

I find the Ivy API to be immensely complicated.

What is the simplest possible snippet to retrieve an artifact from Maven Central into a specific local directory usin

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 05:36

    The simplest way to retrieve an artifact (and it's dependencies) is to use ivy from the command-line

    java -jar ivy.jar -dependency commons-logging commons-logging 1.1 -retrieve "/my/destination/[artifact](-[classifier]).[ext]"
    

    This will retrieve the files into the directory "/my/destination".

    Other examples:

    • using IVY dependencies manager programmatically
    • Using Maven to download dependencies to a directory on the command line

提交回复
热议问题