Menu

#163 Some rules throwing ClassNotFoundException

open
nobody
None
5
2014-10-02
2014-10-01
No

So I'm running a CodeNarc as an ant task with a custom ruleset.

It was working just fine with my IllegalRegexRule rules, but I tried adding a new one.

I put this into my ruleset:

<rule class='org.codenarc.rule.formatting.MissingBlankLineAfterPackage'>
    <property name='priority' value='1'/>
</rule>

And I see this when I build:

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (codenarc) on project myProject: An Ant BuildException has occured: java.lang.ClassNotFoundException: org.codenarc.rule.formatting.MissingBlankLineAfterPackage

Any idea why this is happening? Tried both version 0.18 and 0.21 of CodeNarc.

Discussion

  • Chris Mair

    Chris Mair - 2014-10-02

    It looks like you are missing the "Rule" at the end of the class name: MissingBlankLineAfterPackageRule.

    If you use the Groovy DSL ruleset rather than the XML format, you can just specify the rule name, e.g. "MissingBlankLineAfterPackage".

     
  • Eric Wehrmeister

    Thanks, that did it! Pretty bad oversight on my part...

     

Log in to post a comment.