Sunday, December 14, 2014

Grails and GSON : Could not find artifact


I had the following problem by adding GSON at my project :

Error |
Resolve error obtaining dependencies: Could not find artifact com.google.code.gson:gson:zip:2.3.1 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)


Solution was simple.To solve this problem, put GSOn in dependencies section and not in plugin section :

dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        runtime 'mysql:mysql-connector-java:5.1.24'
        compile 'com.google.code.gson:gson:2.3.1'
    }
More details on : http://stackoverflow.com/a/20974287/2473598