I'm trying to use Grape for:
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' )
However when I add that line in IntelliJ, I get the message:
Error:Groovyc: While compiling [project]: Cannot @Grab without Ivy, please add it to your module dependencies (NoClassDefFoundError: org/apache/ivy/plugins/resolver/DependencyResolver)
I tried to lookup how to do this but couldn't find a clear step-by-step guide (I'm very new to this)
Adding the IvyIDEA plugin didn't seem to resolve the issue.
I tried downloading the library but nothing I type in the search box seems gives any results (ivy
, apacheivy
, apache-ivy
, ivy-2.5
etc.)
Then I tried downloading the jar itself from http://ant.apache.org/ivy/download.cgi - I chose the apache-ivy-2.5.0-src.zip
option and unzipped it and then tried adding it as a dependency:
When I select the unzipped folder, I end up with an Empty Library
- maybe it's looking for a .jar file instead of a folder? But when I unzipped the download there was no .jar in there so I'm not sure if I maybe did the download wrong..?
Then I thought to try adding ivy as a dependency in my project's build.gradle but couldn't find the syntax for how to add it - every google search took me to links about Ivy itself. The maven website's "gradle" tab also isn't working:
So I tried a few things in my root project's build.gradle like so:
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.11'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'ant.apache.org:ivy-2.5.0'
}
IntelliJ can't find the ivy dependency as I've typed it but I have no idea what it's supposed to look like and can't find the appropriate syntax.
I'm really struggling with this but also feel like it shouldn't be this difficult for me to get this working. Can someone give me a super explicit step by step for how to get my Grape line for http-builder working?