Sameer
Sameer

Reputation: 33

How to pick maven jar from grails application

I have a grails 2.4.3 application , now i want to fetch a jar from maven although i have added the repo location but while building the application grails always looks at grailscentral , how to get the jar from maven?

the cxf jar location at maven ( for ivy type ) is

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle -->
<dependency org="org.apache.cxf" name="cxf-bundle" rev="2.3.1"/>

i added the mavenRepo in repositories , but the dependency is not being picked up and showing error

Build config snippet:

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

        grailsPlugins()
       grailsHome()
        mavenLocal()
       grailsCentral()
        mavenCentral()
        // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
        //mavenRepo "http://repository.codehaus.org"

        mavenRepo "https://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle"




        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        // runtime 'mysql:mysql-connector-java:5.1.29'
        // runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
        test "org.grails:grails-datastore-test-support:1.0-grails-2.4"
        <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle -->
        <dependency org="org.apache.cxf" name="cxf-bundle" rev="2.3.1"/>

    }

Upvotes: 0

Views: 47

Answers (1)

erichelgeson
erichelgeson

Reputation: 2340

While Grails 2 uses ivy internally for resolving dependencies - that's not the format you use in BuildConfig.groovy. You've pasted xml into a groovy file which wont work.

Follow the convention of the dependencies directly above it, eg:

compile "org.apache.cxf:cxf-bundle:2.3.1"

Upvotes: 1

Related Questions