1
votes

I get

Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:rest-client-builder:jar:2.1.1 in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)

With this BuildConfig.groovy:

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()
    mavenRepo "http://repo.spring.io/milestone"
    mavenRepo "http://repo1.maven.org/maven2/"
    mavenRepo "http://repo.grails.org/grails/core"
    mavenRepo "http://repo.grails.org/grails/plugins"
}

dependencies {
    test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
    compile 'commons-beanutils:commons-beanutils:1.8.3'
    runtime 'mysql:mysql-connector-java:5.1.34'
    compile 'com.maxmind.geoip2:geoip2:2.7.0'
    compile 'org.apache.httpcomponents:httpclient:4.5.2'
    compile "org.grails.plugins:rest-client-builder:2.1.1"
}

I tried the usual:

 grails clean
 grails refresh-depenencies

But no luck. Lots of people have had the same issue, but none of their "fixes" have worked unfortunately.

1
It should be declared as a grails plugin dependency under plugins dsl as plugins { compile ':rest-client-builder:2.1.1' }. - dmahapatro
Yep, thats it! the documentation was wrong, it said to put it in dependencies, not plugins. Working now! - John Little
Where? To correct it. - rvargas
There are my mavenRepo in BuildConfig.groovy. Try add this in repositories mavenRepo "http://repo.grails.org/grails/repo/" - ntlam
does the solution worked ? - Wit Wikky

1 Answers

2
votes

Solution courtesy of dmahapatro, move the definition into plugins:

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()
    mavenRepo "http://repo.spring.io/milestone"
    mavenRepo "http://repo1.maven.org/maven2/"
    mavenRepo "http://repo.grails.org/grails/core"
    mavenRepo "http://repo.grails.org/grails/plugins"
}

plugins { 
    build ":tomcat:8.0.20"
    :
    compile "org.grails.plugins:rest-client-builder:2.1.1"
}