Grails global config/dependency resolution

Viewed 1361

I'm behind a firewall that doesn't allow me to download from grailsCentral or mavenCentral. But there is one specific public maven repository that IT lets me download from (say 'repo.maven.apache.org'). Is there a way to configure grails with a global configuration? Or more specifically to use a repository globally?

Excerpt from BuildConfig.groovy

grails.project.dependency.resolution = {
  inherits 'global'
  log 'warn'

  repositories {
    grailsCentral()
    mavenLocal()
    mavenCentral()
    mavenRepo 'http://repo.grails.org/grails/libs-releases'

    // Normally I would add this line to every project
    //mavenRepo 'http://repo.maven.apache.org/maven2/'
  }
...

Is there a way that I can create a file like ~/.grails/BuildConfig.groovy that has content like the following?

grails.global.dependency.resolution = {
  repositories {
    mavenRepo 'http://repo.maven.apache.org/maven2/'
  }
}

Then this repo would be used for every project.:)

2 Answers
Related