This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Target over-rides specified in the build.xml are no longer being run when you run a project. It is instead creating an executer and running this instead. As a simple example a created a default java application (accept all defaults) and then edited the build.xml file to hold the following target <target name="run"> <echo>hello</echo> </target> The end of the output log from the ant command follows (set to verbose) parsing buildfile C:\Documents and Settings\rossgr\.netbeans\dev\var\cache\executor-snippets\run.xml with URI = file:/C:/Documents%20and%20Settings/rossgr/.netbeans/dev/var/cache/executor-snippets/run.xml Project base dir set to: C:\Documents and Settings\rossgr\.netbeans\dev\var\cache\executor-snippets Build sequence for target(s) `run' is [run] Complete build sequence is [run, ] run: Override ignored for property "run.jvmargs" Override ignored for property "work.dir" Executing 'C:\Java\jdk1.6.0\bin\java.exe' with arguments: '-classpath' 'C:\Projects\JavaApplication14\build\classes;C:\Projects\JavaApplication14\src' 'javaapplication14.Main' The ' characters around the executable and arguments are not part of the command. BUILD SUCCESSFUL (total time: 0 seconds) On invoking the run command the system should call the overridden target, instead it just calls the target in the executer. This seems to be the case whether you override "run" or (more usually) -post-jar etc. I last observed this working properly in 6.5M1.
Caused by CoS?
Yes it is something to do with Compile On Save. I switched the CoS option off and it ran faultlessly
Unfortunately this is how it works when Compile on Save is turned on. The project is in such case executed by different script. If you want to override targets in build.xml then you need to turn off CoS.
could we create a FAQ for it?
We probably should. Any volunteer? :)
Maybe deserves a release note mention: if you have overridden the 'run' target or similar, you will need to disable CoS in order for this override to be used when running in the IDE. Possibly j2seproject could default disable.compile.on.save to true rather than false (there is a separate issue noting that the negative sense of this property is confusing!) in case run-related target overrides are detected in build.xml? Not sure if this would really be a good idea.
A release note is not sufficiently discoverable by itself. Filed issue 147007 and issue 147008 to try to address this.
Great, thank you.
*** Issue 148340 has been marked as a duplicate of this issue. ***