chrismair / GrailsCodeNarcPlugin

Grails CodeNarc plugin
Apache License 2.0
10 stars 5 forks source link

groovy.lang.MissingMethodException: No signature of method: Codenarc.ruleset() #10

Closed rvargas closed 8 years ago

rvargas commented 8 years ago

I get this error in Grails 2.5.5 using Codenarc 0.25.2:

groovy.lang.MissingMethodException: No signature of method: Codenarc.ruleset() is applicable for argument types: (Codenarc$_run_closure1) values: [Codenarc$_run_closure1@739fa02f] Possible solutions: sleep(long), use([Ljava.lang.Object;) Error | at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58) Error | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:81) Error | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) Error | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) Error | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) Error | at Codenarc.run(Codenarc.groovy:1) Error | at Codenarc$run.call(Unknown Source) Error | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) Error | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) Error | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) Error | at gant.Gant.prepareTargets(Gant.groovy:607) Error | at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeWithGantInstance(GrailsScriptRunner.java:775) Error | at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptFile(GrailsScriptRunner.java:571) Error | at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:470) Error | at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:421) Error | at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand(GrailsConnectorImpl.java:160) Error | at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:130) Error | at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:93) Error | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Error | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) Error | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) Error | at java.lang.reflect.Method.invoke(Method.java:606) Error | at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:236) Error | at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)

Any help?

chrismair commented 8 years ago

I was not able to reproduce this error. I did a fresh install of Grails 2.5.5 on my Ubuntu system with Java 1.8. Then I ran into this problem (module not found: org.codehaus.groovy#groovy-all;2.4.4): https://github.com/grails/grails-core/issues/10011 So I installed Grails 2.5.4 first. I setup a very simple sample Grails app and added the CodeNarc plugin, and created some code with violations. Then I ran grails codenarc. That worked. Then I switched to Grails 2.5.5, and created a sample app with violations and ran grails codenarc. That worked, too.

Your stacktrace looks like some kind of Grails classpath/dependency issue. Are you able to try with different a Grails version?

rvargas commented 8 years ago

I think I found my error, I called my ruleset file Codenarc.groovy. Or this can't be related?

chrismair commented 8 years ago

I'm not sure, but that could very well match up with that error stacktrace. I suggest renaming your ruleset something else.

rvargas commented 8 years ago

Thanks! I'll close this issue.