How to import groovyx.net.http

后端 未结 3 1680
别跟我提以往
别跟我提以往 2020-12-16 13:05

I don\'t understand maven or grape, and I\'m an idiot so give me the step by step if your answer is \"go grap X-dependency manager and then rtfm and you\'re set.\" Where do

相关标签:
3条回答
  • 2020-12-16 13:38

    try importing the .jar for HTTPBuilder-http://repository.codehaus.org/org/codehaus/groovy/modules/http-builder/http-builder/0.5.2/

    0 讨论(0)
  • 2020-12-16 13:42

    Since you're talking about BuildConfig.groovy I assume the question is targeted at using HttpBuilder in a grails application. If so, you could either use

    compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0') {
            excludes "commons-logging", "xml-apis", "groovy"
    }
    

    in the dependencies-section of BuildConfig.groovy, or, even more easier, just install the rest plugin:

    grails install-plugin rest
    
    0 讨论(0)
  • 2020-12-16 14:01

    Thom Nichols actually provided a helpful answer at http://groovy.329449.n5.nabble.com/problem-running-http-builder-code-td3995735.html to a similar question.

    Basically, you can get into one of the snapshot directories at http://snapshots.repository.codehaus.org/org/codehaus/groovy/modules/http-builder/http-builder/ and download one of the packages ending with 'all'. Inside there, you'll find a dependencies directory that contains all the dependencies you need, which you can place in your lib directory. The root of the all zip (or tar) file should contain the main http-builder-#.#-SNAPSHOT.jar, which you should also place in lib.

    I was doing this just from the Groovy Console. For Grails, I imagine Stefan's answer of just installing the Grails rest plugin is the best bet.

    0 讨论(0)
提交回复
热议问题