You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Fortin <mf...@monetizeit.com> on 2007/10/03 23:33:05 UTC

extension for checkstyle working

Hi

I've been trying to get a custom checkstyle check to work but I get an 
error that checkstyle can't find my custom check.  I wrote a a script to 
run checkstyle by hand and it works so I know my check is correct.  My 
check is in my local repository and I can see it in the maven log output 
when I turn on debug.  I looked at checkstyles source and it's throwing 
either an InstantiationException or a IllegalAccessException in 
PackageObjectFactory but I can't tell because the stack trace is clipped 
off.  Checkstyle gets it's classloader from it's current thread, could 
it a a security issue?  I followed the directions from mavens site and 
I've seen a few references to using the full class name instead of just 
the abbreviation but with no resolution.  How do I get my custom check 
to work in maven?

Any help would be greatly appreciated.


error
[ERROR] BUILD ERROR
[INFO] --------------------------------------------------------------
[INFO] An error has occurred in Checkstyle report generation.

Embedded error: Failed during checkstyle configuration
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheckCheck

...

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: 
cannot initialize module TreeWalker - Unable to instantiate 
com.monetizeit.checkstyle.BlanklineCheck
        at 
com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:165)
        at 
com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:209)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(CheckstyleReport.java:723)
        at 
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:484)
        ... 20 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: 
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheck
        at 
com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
        at 
com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:213)
        at 
com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:209)
        at 
com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:144)
        ... 23 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: 
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheckCheck
        at 
com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:94)
        at 
com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:149)
        ... 26 more

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org