My NetBeans Configuration

October 2013 was the last month I used Eclipse Kepler. After years the bumpy maven support was reason enough for me to have a look again at NetBeans. When I first started out to develop programs in Java, there was no free IDE available, except Forte for Java, which is the predecessor of todays NetBeans. I used it back then, but with the emerging of Eclipse, my employer made it’s usage mandatory for all programmers.
Todays NetBeans has nothing in common with the slow and clumsy Forte for Java. NetBeans now is fast, responsive and elegant. The flawless maven support of NetBeans was the first feature that got me excited about this IDE. My actual work environment allows me to choose between Eclipse or NetBeans. Currently I am the only one who is using NetBeans for the complete development lifecycle, but interest is growing and already some co-workers are using at least matisse to design their java swing frames.
Checkstyle usage and an Eclipse Formatter Defintion are mandatory for everyone. Unfortunately no guidelines are given, how to make NetBeans compliant with our checkstyle and formatting rules. Not a big issue with Eclipse, but some thinking is to be done, when using NetBeans to make it compliant with my companies standards.

Here is what I did:

Checkstyle Support
The “Software Quality Environment” provides support for most code checkers and does it’s job very well. Have a look at it here: https://kenai.com/projects/sqe/pages/Home.

Eclipse Formatter
Surprisingly there is also a NetBeans plugin available, that does the trick: formatting of source files according to rules specified in an eclipse formatter definition file. Check it out here: http://benkiew.wordpress.com/2013/11/14/new-version-of-java-eclipse-code-formatter-plugin-available/.

Explore from here
Nice little plugin, that starts the Microsoft Explorer with your projects directory selected. You may select it’s menu entry from right clicking on the NetBeans project root node.

License Changer
Ever had to change the licenses in your source files header? This plugin comes to the rescue:
http://plugins.netbeans.org/plugin/17960/license-changer

Here you will find the highlights of NetBeans keyboard shortcuts and code templates:
https://netbeans.org/project_downloads/usersguide/shortcuts-74.pdf

Other Settings

NetBeans default font is too small for my eyes. The font size can be set in <home>/etc/netbeans.conf. Add “--fontsize 13” to “netbeans_default_option”. Change the font size to a value that suits you.

Choose Tools -> Options -> Java -> Maven and set “Skip Tests for any build executions not directly related to testing”. This makes sure that your tests are no executed when building your project.

Choose Tools -> Options -> Editor -> Formatting. Select Language “Java” and Category “Comments” and deselect “Enable Comments Formatting”. The comments formatting regularly removes blanks from my thoroughly designed license header in source code files. Therefore I deselect it.

Choose Tools -> Options -> Editor -> Macros. Enter new macro name “join-line”, shortcut Ctrl+J, macro code is:
caret-end-line selection-down selection-first-non-white remove-selection