How to resolve java dependency from the command line without maven
Posted by Piotr Gabryanczyk on September 26, 2010
I want to be able to download java library and it’s dependencies using simple command-line tool i.e.
ivy.sh resolve jetty jetty 5.1.10
- Download Ivy. Ivy understands maven repositories and can do the job for you.
- Create a script ivy.sh in ivy installation directory with the following content:
cd=`dirname $0` if [ "$1" == "resolve" ]; then shift echo "Resolving $1 $2 $3" java -jar $cd/ivy-2.2.0-rc1.jar -retrieve ./[artifact]-[revision]-[type].[ext] -dependency $* fi
- Make your script executable:
chmod a+x ivy.sh
- Add it to the path ie. ~/.bash_profile