## 3.7.2 Dependency Repositories

#### Remote Repositories

Grails, when installed, does not use any remote public repositories. There is a default `grailsHome()` repository that will locate the JAR files Grails needs from your Grails installation. If you want to take advantage of a public repository you need to specify as such inside the `repositories` block:

    repositories {
        mavenCentral()
    }

In this case the default public Maven repository is specified. To use the SpringSource Enterprise Bundle Repository you can use the `ebr()` method:

    repositories {
        ebr()
    }

You can also specify a specific Maven repository to use by URL:

    repositories {
    	mavenRepo "http://repository.codehaus.org"
    }

#### Local Resolvers

If you do not wish to use a public Maven repository you can specify a flat file repository:

    repositories {
    	flatDir name:'myRepo', dirs:'/path/to/repo'
    }

#### Custom Resolvers

If all else fails since Grails builds on Apache Ivy you can specify an Ivy resolver:

    repositories {
    	resolver new URLResolver(...)
    }

#### Authentication

If your repository requires some form of authentication you can specify as such using a `credentials` block:

    credentials {
    	realm = ".."
    	host = "localhost"
    	username = "myuser"
    	password = "mypass"
    }

The above can also be placed in your `USER_HOME/.grails/settings.groovy` file using the `grails.project.ivy.authentication` setting:

    grails.project.ivy.authentication = {
    	credentials {
    		realm = ".."
    		host = "localhost"
    		username = "myuser"
    		password = "mypass"
    	}
    }