Last Updated: February 25, 2016
·
974
· opatry

Apache Ivy command line wrapper

If you are used to Apache Ivy, you certainly use it through Gradle or Ant. Sometimes, these tools are not available or not wanted but Ivy still is a great tool to manage artifacts and dependencies.

TL;DR: https://github.com/opatry/ivy-wrapper

#!/bin/bash

if [[ -z "${IVY_HOME}" ]]; then
  echo "IVY_HOME must be set"
  exit 1;
fi

pushd $IVY_HOME >> /dev/null
IVY_JAR=$(find *ivy*.jar)
popd >> /dev/null

java -jar ${IVY_HOME}/${IVY_JAR} $@
exit $?

Explanations

Apache Ivy provides a command line interface which solves this issue but is a little bit verbose for a daily basis usage.

You can easily create a shell script that wraps the Java invocation verbosity to get a clean & concise command line invocation:

Such script may nicely replace the following invocation:

$ java -jar $IVY_HOME/ivy-$IVY_VERSION.jar -version

by

$ ivy -version