nbCheckstyle_Update - plugin detail

This plugin updates the original nbCheckstyle plugin to provide support for Netbeans 5.5 and checkstyle 4.2. This enables JDK 1.5 source checking, which was not possible with the earlier release of the plugin. The distribution consists of a zip file containing two nbm files that need to be installed via the Tools/Update Center option of the Netbeans IDE. The plugin no longer requires the System option to set up the location of the checkstyle configuration file. However, the location of the checkstyle file to use has to be set via a System property NB_CHECKSTYLE_CONFIG_FILE (passed in the netbeans.conf file in the etc directory). After the plugin nbms are installed, you should see a "Run Checkstyle" option in the pop-up menu displayed whenver you right-click in the Editor inside a Java source file. You might also like to look at the Checkstyle Beans plugin (http://www.sickboy.cz/checkstyle) that has better integration with the Netbeans 6.0 editor interface.

n/a
Plugin owner: ranga_gopalan
Website:
Added: 2007-03-09
License: Free
Category: Programming Languages
Downloaded: 1,588 times
Rating:
 3.63, by 2 users

Plugin Log Show log

Versions available

Download plugin   Download size: 1.17 MB   Last Update: 2007-12-03

What's new in this version

Tested and bug-fixed to work with 6.0. Fixed issue with earlier release had an undocumented dependency on the "Commons-Logging Integration" library which caused errors when trying to use it.

Verifications for NetBeans versions

Plugin is not subject to any verification



Introduction

This plugin updates the original nbCheckstyle plugin to provide support for Netbeans 5.5 and checkstyle 4.2. This enables JDK 1.5 source checking, which was not possible with the earlier release of the plugin.

The distribution consists of a zip file containing two nbm files that need to be installed via the Tools/Update Center option of the Netbeans IDE.

  • 1. checkstyle42.nbm: This is a library wrapper module for Checkstyle version 4.2 and contains the checkstyle jars.
  • 2. nbCheckstyle.nbm: This is the updated Netbeans 5.5 version of the original nbCheckstyle plugin with minor changes.

The plugin no longer requires the use of a System option to configure the location of the Checkstyle rules XML file. However, the location of the checkstyle file to use has to be set via a System property NB_CHECKSTYLE_CONFIG_FILE (set in the netbeans.conf file in the etc directory under the netbeans installation). Also, required the checkstyle4.2 library wrapper moduleto be installed. The default value for the configuration file is set to c:\temp\sun_checks.xml. This also requires a restart of the IDE so that the netbeans.conf file is reloaded.

In order to set the location of the Checkstyle configuration file edit your netbeans.conf file under the location $NETBEANS_HOME/etc/netbeans.conf. Append the "-J-DNB_CHECKSTYLE_CONFIG_FILE=your_config_file_path" string to the netbeans_default_options parameter, where your_config_file_path is the location of your valid Checkstyle configuration XML file.

This work was done because we were using JDK 1.5 for our project and the original plugin (which wrapped checkstyle version 3.5) did not support Generics. A deliberate choice was made (to take the easy way out) and avoid the use of the deprecated SystemOption API, especially since Netbeans 6 is introducing the NbPreferences approach as well.
Hope this is useful. Enjoy!

You might also like to look at the Checkstyle Beans plugin that has better integration with the Netbeans 6.0 editor interface.

[ You have to be logged in to be able to comment. ]

User Comments

  

An error occurred during initialization.

Hello Ranga Gopalan,

I have installed the module(s) in NetBeans 5.5 (JDK 1.5.0_11) and placed the file sun_checks.xml in the directory C:\temp\, but when I run Checkstyle I get the following error:


An error occurred during initialization.
Make sure there is a configuration file available at: c:\temp\sun_checks.xml
You can change the file location by editing your netbeans.conf file
and adding the -J-DNB_CHECKSTYLE_CONFIG_FILE=your_config_file_path to the
netbeans_default_options parameter setting
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:5
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:2
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:2
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:3
at org.apache.commons.beanutils.ConvertUtilsBean.(ConvertUtilsBean.java:1
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.createBeanUtilsBean(AutomaticBean.java:
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:1
at com.goulbourn.doenforcer.CheckStyleAction.runChecker(CheckStyleAction.java:2
at com.goulbourn.doenforcer.CheckStyleAction.performAction(CheckStyleAction.java:1
at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:5
at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:
at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:5
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:21
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:2
at javax.swing.AbstractButton.doClick(AbstractButton.java:3
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:10
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:10
at java.awt.Component.processMouseEvent(Component.java:55
at javax.swing.JComponent.processMouseEvent(JComponent.java:31
at java.awt.Component.processEvent(Component.java:52
at java.awt.Container.processEvent(Container.java:19
at java.awt.Component.dispatchEventImpl(Component.java:39
at java.awt.Container.dispatchEventImpl(Container.java:20
at java.awt.Component.dispatchEvent(Component.java:38
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:42
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:38
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:38
at java.awt.Container.dispatchEventImpl(Container.java:20
at java.awt.Window.dispatchEventImpl(Window.java:17
at java.awt.Component.dispatchEvent(Component.java:38
at java.awt.EventQueue.dispatchEvent(EventQueue.java:4
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:1
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:1
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:1
at java.awt.EventDispatchThread.run(EventDispatchThread.java:1
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:4
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:5
... 37 m
Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:4
... 38 m
Done.


Could you please help me?

with kind regards,

Marc Beckers
Posted by marcbeckers on May 16, 2007
  

GoGoGo

I'm already looking for a checkstyle plugin quite a while. There is another projecthttp://code.google.com/p/checkstyle4nb/, but this guy seems not to actively develop checkstyle plugin and it also does not work on jdk6.0 with 5.5.1 and 6.0Mx, since when running checker.process(...) to call checkstyle it produces this weird "java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token" where I have no clue where it comes from. However in this project there is a options dialogue to add the config file.

Maybe you could merge this two projects to one and make it working also with jdk6.0 with the latest Nb versions. That would totally rock, I couldn't figure it out!
Posted by tomzi on Apr 25, 2007
  

It isn't working under nb 5.5 installation

This module isn't working under nb 5.5. You get always Error message that checksyte.xml file was not found. Exactly the same as mentioned in the prevous comment. The path to xml file is set as mentioned above in nb conf file.
Posted by wbabachan on Apr 16, 2007
  

RE: Not working with my nb 5.5 installation

Are you sure you have a checkstyle config file at the location logged in the error message - "/home/irockel/development-6_0/devel/commons/build/checkstyle.xml" ? The checkstyle rules configuration XML file needs to be accesible for the plugin to work.
Posted by ranga_gopalan on Mar 30, 2007
  

Not working with my nb 5.5 installation

Hi,

if I try to run the checkstyle plugin, I get the following:

An error occurred during initialization.
Make sure there is a configuration file available at: /home/irockel/development-6_0/devel/commons/build/checkstyle.xml
You can change the file location by editing your netbeans.conf file
and adding the -J-DNB_CHECKSTYLE_CONFIG_FILE=your_config_file_path to the
netbeans_default_options parameter setting
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:5
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:2
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:2
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:3
at org.apache.commons.beanutils.ConvertUtilsBean.(ConvertUtilsBean.java:1
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.createBeanUtilsBean(AutomaticBean.java:
Posted by irockel on Mar 28, 2007
  

Not working

This module does not seem to work in Nb 5.5.1beta and Nb 6.0M7
Posted by tomzi on Mar 13, 2007
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo