Installing Ivy plugin?
I'm new to IntelliJ (using 10.0) and Groovy. In trying to use the @Grab annotation in Groovy, I get an error that says "Cannot @Grab without Ivy, please add it to your module dependencies (NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport)". So now I look to the Ivy plugin, but the instructions are not clear for how to install it. I'm looking here:
http://plugins.intellij.net/plugin/?id=3612
and here:
http://confluence.jetbrains.net/display/CONTEST/Getting+Started
but the "getting started" page seems to start not at the beginning but somewhere in the middle. Normally I think installing a plugin should be an easy exercise. Can anyone point me to some working instructions?
Thanks.
Please sign in to leave a comment.
Hello Matt,
You don't need to install the Ivy plugin to have @Grab work; you just need
to add Ivy itself to the dependencies of your module.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Can you clarify how I am supposed to add an Ivy dependency to my module in Idea? I'm working with a project that was created as a Java/Maven project.
Thanks.
Hi Matt,
Please check this reference page.
Denis
Denis,
That's exactly where I was looking. However, previously in this thread I was told that I did not need to download and install the Ivy plugin. If that's the case, then what library or libraries am I supposed to add to the dependencies? Surfing around the Jetbrains installation, I didn't see anything that looks like Ivy. There was no Ivy folder in the plugins directory. Therefore I decided to go ahead and install the IvyIdea plugin via File->Settings->Plugins->Available. After installing it, I can see IvyIdea occur in a couple of places on the GUI, but there is still nothing called Ivy or IvyIdea in the plugins folder of the Idea installation. Nor can I see anything Ivy-related to select when I try to add a dependency via Open Module Settings->Project Structure dialog->Dependencies tab->Add. Is this Ivy dependency a Single-Entry Module Library, Library, or Module Dependency? It doesn't seem to matter which I pick, as there still seems to be nothing Ivy-related to select in any case (and this was true both before and after I actually installed the IvyIdea plugin). And of course I still get my compiler error:
Cannot @Grab without Ivy, please add it to your module dependencies (NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport)
If I go to the IvyIdea page and manually download the plugin, I can see it contains 5 jars. So I suppose I could manually drop the IvyIdea plugin into the plugins folder and see what happens, but I'm inclined to trust that process less than actually managing the plugin/dependency from the Idea application itself, which is what I've tried so far.
Thanks,
Matt
Hi Matt,
Just download ivy jars from http://ant.apache.org/ivy and add them as dependencies to your module.
Denis
That did resolve the compilation error on @Grab, thanks.
I added these lines found at https://mvnrepository.com/artifact/org.apache.ivy/ivy to my project's pom.xml so Maven could resolve the dependency:
<
dependency
>
<!-- support @Grab in Groovy scripts -->
<
groupId
>org.apache.ivy</
groupId
>
<
artifactId
>ivy</
artifactId
>
<
version
>2.4.0</
version
>
<
scope
>provided</
scope
>
</
dependency
>