Netbeans uses ant to execute maven projects.
Steps to reproduce:
1. Run maven project via F6 or "Run" context menu
Netbeans uses maven exec plugin
2. Stop project execution and re-run it via F6 or "Run" menu.
Netbeans uses ant now.
There is similar issue (http://netbeans.org/bugzilla/show_bug.cgi?id=198912) that has status RESOLVED INVALID. I'm not sure if this is designed behavior, but at least, there is related issue (http://netbeans.org/bugzilla/show_bug.cgi?id=215575) which is definitely bug.
with Compile on Save enabled, the subsequent executions will be performed by the IDE. That's unfortunately done through Ant further increasing confusion.
if Compile on Save doesn't work for you, just disable it. It's only working for the simple cases, please be aware however that the Ant execution is only part of the Compile on Save functionality, specifically tailored for jar based projects with a main method. For war projects we (re)deploy the apps for example. And CoS can also be used together with jrebel or javeleon for live class reloading.
Thanks! Disabling Compile on Save works for me. Now I see that was designed behavior. Should I change status to RESOLVED (I cannot see INVALID option)?
Could you please look at http://netbeans.org/bugzilla/show_bug.cgi?id=215575 ?
That is the only thing, that blocks me from using 'Compile on Save' feature.
-> P1, TASK. not to be immediately fixed, but in the long term we should keep using maven even for quick executions without compilation