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.

Bug 145772 - Target overrides in build.xml no longer working
Summary: Target overrides in build.xml no longer working
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jesse Glick
Keywords: RELNOTE
: 148340 (view as bug list)
Depends on:
Reported: 2008-09-01 09:56 UTC by graeme_m_ross
Modified: 2008-09-25 16:30 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description graeme_m_ross 2008-09-01 09:56:00 UTC
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">

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 =
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, ]
Override ignored for property "run.jvmargs"
Override ignored for property "work.dir"
Executing 'C:\Java\jdk1.6.0\bin\java.exe' with arguments:
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.
Comment 1 Antonin Nebuzelsky 2008-09-02 09:56:10 UTC
Caused by CoS?
Comment 2 graeme_m_ross 2008-09-02 12:06:48 UTC
Yes it is something to do with Compile On Save. I switched the CoS option off and it ran faultlessly
Comment 3 Milan Kubec 2008-09-04 09:36:56 UTC
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.
Comment 4 Lukas Hasik 2008-09-04 11:15:13 UTC
could we create a FAQ for it?
Comment 5 Jan Becicka 2008-09-04 13:58:56 UTC
We probably should. Any volunteer? :)
Comment 6 Jesse Glick 2008-09-10 02:41:38 UTC
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 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.
Comment 7 nimarukan 2008-09-12 00:36:00 UTC
A release note is not sufficiently discoverable by itself.
Filed issue 147007 and issue 147008 to try to address this.
Comment 8 Jesse Glick 2008-09-12 17:41:51 UTC
Great, thank you.
Comment 9 Jesse Glick 2008-09-25 16:30:29 UTC
*** Issue 148340 has been marked as a duplicate of this issue. ***