Skip to content

Instantly share code, notes, and snippets.

@andresteingress
Created April 12, 2013 07:06
Show Gist options
  • Select an option

  • Save andresteingress/5370086 to your computer and use it in GitHub Desktop.

Select an option

Save andresteingress/5370086 to your computer and use it in GitHub Desktop.
Groovy Common Extensions not found in groovyConsole and scripts
@Grapes(Grab(group='com.bloidonia', module='groovy-common-extensions', version='0.4.1'))
def f = new File('test.zip')
f.unzip(new File('test'))
@andresteingress
Copy link
Author

12.04.2013 09:05:25 org.codehaus.groovy.runtime.StackTraceUtils sanitize
WARNUNG: Sanitizing stacktrace:
groovy.lang.MissingMethodException: No signature of method: java.io.File.unzip() is applicable for argument types: (java.io.File) values: [test]
Possible solutions: size(), wait(), mkdir(), dump(), grep(), any()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at ConsoleScript2.run(ConsoleScript2:3)

@timyates
Copy link

Oddly, this seems to work:

@Grab( 'com.bloidonia:groovy-common-extensions:0.4.1')
import java.io.File

def f = new File('test.zip')
f.unzip(new File('test'))

and

@Grab( 'com.bloidonia:groovy-common-extensions:0.4.1')
def f = new File('test.zip')
f.unzip(new File('test'))

works as well

@andresteingress
Copy link
Author

Solution: the @ at Grab is missing:

@Grapes(@grab(group='com.bloidonia', module='groovy-common-extensions', version='0.4.1'))

@timyates
Copy link

Ahhhhhhhh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment