# install-dependency

## Purpose

Installs a JAR dependency, making it available to Griffon dependency resolution mechanism.

## Examples

    griffon install-dependency mysql:mysql-connector-java:5.1.5
    griffon install-dependency mysql:mysql-connector-java:5.1.5 --dir=lib
    griffon install-dependency --group=mysql --name=mysql-connector-java --version=5.1.5

## Description

Usage:

    griffon install-dependency [dependency]

Arguments:

- `group` - The group of the dependency
- `name` - The name of the dependency
- `version` - The version of the dependency
- `repository` - The repository to resolve from
- `dir` - The target directory to resolve JAR files to

The `install-dependency` command allows the installation of a JAR dependency into the Ivy cache so that it can be resolved locally (without needing to configure a repository explicitly).

In its most simple form you can pass a single argument that defines the dependency in the form "group:name:version":

    griffon install-dependency mysql:mysql-connector-java:5.1.5

Griffon has some built in common public Maven repositories that will be used to resolve the dependency. If the dependency is not found you can specify your own repository using the `repository` argument:

    griffon install-dependency mysql:mysql-connector-java:5.1.5 --repository=http://download.java.net/maven/2

By default the JARs will be resolved to your local Ivy cache (typically `USER_HOME/.ivy2/cache`), if you wish the JAR files to be placed in an alternative directory you can use the `dir` argument:

griffon install-dependency mysql:mysql-connector-java:5.1.5 --dir=lib