Maven 1.x Checkstyle Plugin

checkstyle use the root classloader to instantiate checker

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.4.1, 3.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 1.0
  • Number of attachments :
    0

Description

when i make myself checker, i have to change the forehead.conf to add my jar file to the root class loader, otherwise, when i put the jar file in my project.xml dependency list, the plugin show me the error "Unable to create a Checker: cannot initialize module TreeWalker - Unable to instantiate net.zhyang.checkstyle.ConstantsCheck".

I think the reason is the checkstyle always try to find class in same classloader(root classloader). if you put your checkstyle.jar in the root classloader, i have to put myself custom checker in the root classloader.

And the
<properties>
<classloader>root</classloader>
</properties>
is also deprecated,if you run under debug, you can see the warning message about it, it's the time to remove it from project.xml.

after i removed them, i can run myself checker.

Activity

Hide
Carlos Sanchez added a comment -

There's a problem if not using root classloader

Show
Carlos Sanchez added a comment - There's a problem if not using root classloader
Hide
Carlos Sanchez added a comment -

See MPCHECKSTYLE-33 to find the reason this can't be fixed as of now

Show
Carlos Sanchez added a comment - See MPCHECKSTYLE-33 to find the reason this can't be fixed as of now

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: