Closed igorrosenberg closed 11 years ago
Oh... This is the result of an API change in groovy itself... groovy 1.7.8 : org.codehaus.groovy.transform.powerassert.AssertionRenderer groovy 1.8.4 : org.codehaus.groovy.runtime.powerassert.AssertionRenderer Hence the requirement groovy 1.7 for this plugin
Out of curiosity, would it be hard to make the plugin groovy 1.8 compliant?
Groovy 1.7/1.8 shouldn't be a problem as long as the "assert" in SourceString.groovy:39 is true.
I am testing the plugin before each release in Eclipse 3.5 - 3.7 and 4.2 with either Groovy 1.7 or 1.8 enabled.
I could reproduce the issue you mentioned with GGTS 3.1.0. If Groovy 1.7 is enabled, the error is: Assertion failed: assert source | "". If Groovy 1.8 is enabled, the error is: java.lang.NoClassDefFoundError: org/codehaus/groovy/transform/powerassert/AssertionRenderer.
Some Groovy files in a project may be empty. For example auto-generated ones from Grails plugins like _Install.groovy and _Upgrade.groovy. CodeNarc asserts that the source to be analyzed is not empty. So this part of the plugin's CheckCodeJob.groovy will fail.
GroovyCompilationUnit unit = (GroovyCompilationUnit) JavaCore.createCompilationUnitFrom(file)
String source = new String(unit.contents)
def analyzer = new StringSourceAnalyzer(source)
Requires a fix from my side.
Released version 0.18.1.
Hello
On Groovy/Grails Tool Suite, Version: 3.1.0.RELEASE, Build Id: 201210061308, I have installed the plugin through http://codenarceclipse.sourceforge.net/eclipse/release
I try to run the plugin on my project's root: Groovy > check code with codenarc I get the popup dialog: "Internal error occurred" , due to a NoClassDefFoundError for AssertionRenderer (trace below)
If I try the plugin on a normal groovy class (for example a Controller), I get no issues. I think the problem cmes from some plugins included by my project. How can I exclude the plugins from codenarc analysis ?
Thanks!