I have a script with a Grapes dependency, shown below:
@Grapes(@Grab(group="commons-io", module="commons-io", version="2.4"))
import org.apache.commons.io.output.TeeOutputStream
...
But when I run it, I'm getting an error that the dependency can't be found.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: commons-io#commons-io;2.4: not found]
java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: commons-io#commons-io;2.4: not found]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
...
I'm using Groovy 2.0.5 with Java 1.6.0_33.
I checked Maven central and the dependency does exist. Why can't Grapes find it?
These two ways work for me in Eclipse, but not in Netbeans. Whichever way you use, your
group
should beorg.apache.commons
or: