Compile on Save mode is on by default for unit tests in Maven projects. Usually this is fine and speeds up the edit-test cycle, but for specialized configurations of Surefire or other plugins it can produce incorrect results. While CoS can be turned off, users do not necessarily realize it was on to begin with. Options (not necessarily exclusive):
1. Show a notification dialog (or status line icon?) when CoS for tests is first used explaining what is going on and how to turn it off.
2. Turn off CoS by default but show a notification dialog when a project would be eligible to use it, offering to enable it.
3. Try harder to determine when CoS would produce different results from Surefire and automatically disable it in those cases.
4. Conversely, interpret more Surefire parameters and pass them to JavaRunner.
5. Provide a global setting for the default CoS mode as well as the current per-project configuration.
as I learned last year at netbeans day from Adam Bien, even the capacity to enable CoS for web apps (non test) execution is not common knowledge and I was asked why it's not on by default.
Deploy on Save (DoS) is in fact on by default - but is only active when CoS is also on for running (app, all), which is not the default. The EE wizard iterator turns it on for newly created projects, creating nb-configuration.xml as an annoying side effect, but this is useless for existing projects.
Since you do not normally have run targets in a Maven SE project, and certainly nothing like the IDE's deploy to configured server for an EE project (just jetty:run and the like), making CoS be enabled for running by default only makes sense.
The question is then whether the default mode should be app or all, i.e. whether CoS should remain on by default for tests. Given the large set of bugs filed about test CoS, usually involving specialized Surefire configuration, and the fact that people are particularly frustrated when tests are not reliable, I am inclined to think it should be off, but with a suggestion to turn on.
Integrated into 'main-golden', will be available in build *201203240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jesse Glick <firstname.lastname@example.org>
Log: #204907: make app, but not test, the default value for CoS.