Blog About Contact

Maven Junit test integration broken in Netbeans 7.2?

Published Sun, 7 Oct 2012

I was having issues after upgrading to Netbeans 7.2 with it not running single JUnit tests (Ctrl+F6 shortcut) in a particular Maven based project. However it would work with other Maven projects. I figured it was a bug in Netbeans.

It turns out that Netbeans 7.2 changed the way single executions of JUnit tests run, so that now they are run by Maven (previously Netbeans had an internal runner).

Maven uses the Surefire plugin (generally) to run JUnit tests, and as it turns out there is a bug in Surefire plugin version 2.12 which broke the running of single JUnit tests.

https://jira.codehaus.org/browse/SUREFIRE-827?page=com.atlassian.jira.plugin.system.issuetabpanels%3aall-tabpanel

And when I checked, sure enough the project that wasn't working was using Surefire plugin 2.12. Changing it to use 2.12.1 fixed the issues.

Sorry Netbeans, it wasn't your fault after all! :)

Hope this helps someone else with the same issue!


About the Author

Richard Nichols is an Australian software engineer with a passion for making things.

Follow him on twitter or subscribe by RSS or email.

You might also enjoy reading -


Discuss / Comment

No one has commented yet.

Add a comment

  • {{e.error}}

Thanks for your comment!/

Required.
Valid email address required.
Required.
Posting message, please wait...