开发者

Groovy Grape imports aren't resolved by Eclipse

groovy eclipse plugin version: 1.7.5.xx-20101020-1000-e36-release.

import com.jidesoft.swing.JideSplitButton

@Grab(group='com.jid开发者_开发百科esoft', module='jide-oss', version='[2.2.1,2.3.0)')
public class TestClassAnnotation {
    public static String testMethod () {
        return JideSplitButton.class.name
    }
}

new TestClassAnnotation().testMethod()

the first line error: Groovy:unable to resolve class com.jidesoft.swing.JideSplitButton

it can run as groovy shell, but the error warning is bore


When I compile this in the editor, I get the same error as I do when I compile or run from the command line:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: com.jidesoft#jide-oss;[2.2.1,2.3.0): not found]

(and then a very long stack trace)

Is this what you are seeing?


I'm rather late to this question, but I wonder if
@Grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0)')
shouldn't be
@Grab(group='com.jidesoft', module='jide-oss', version='[2.2.1,2.3.0]')

It looks to me like a syntax error where groovy expects to be passed a list.


Try placing @Grab right above the import statement. Just like that:

 @Grab(group='com.jidesoft', module='jide-oss',version='[2.2.1,2.3.0]') 
 import com.jidesoft.swing.JideSplitButton

... your code continues here
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜