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 252595 - Missing "onsave" project hook for J2SE Ant build.xml
Summary: Missing "onsave" project hook for J2SE Ant build.xml
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on: 269161
  Show dependency tree
Reported: 2015-05-26 14:25 UTC by Jaroslav Tulach
Modified: 2016-11-29 11:14 UTC (History)
1 user (show)

See Also:
Exception Reporter:

Replacing .netbeans* files with a query like approach (8.28 KB, patch)
2016-06-10 09:11 UTC, Jaroslav Tulach
Details | Diff
Proposed patch (65.65 KB, patch)
2016-08-11 15:18 UTC, Tomas Zezula
Details | Diff
Proposed patch (92.83 KB, patch)
2016-08-15 12:28 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2015-05-26 14:25:54 UTC
I am currently working on Graal and using NetBeans. In Graal one can use any IDE, just call:

$ ideinit

and you should be able to open all the projects in any IDE. That allows people to compare:

One thing where NetBeans lacks behind Eclipse is compile on save feature.

After a bit of analysis it turned out that the missing piece is ability to invoke a custom trigger when Java file is saved and its .class file is generated. Such hook would allow us to register code to JAR the classes into appropriate location, etc.

One possible way to realize this is a property in


which would invoke

ant -f build.xml nameoftarget

on the main build script.
Comment 1 Jaroslav Tulach 2016-05-25 06:09:51 UTC
Comment 2 Tomas Zezula 2016-06-07 15:54:42 UTC
Fixed jet-main a99b75ac5d61
Comment 3 Jaroslav Tulach 2016-06-10 08:15:28 UTC
I've added support in MX to generate $cos.update:

That isn't however enough. NetBeans needs to really get convinced to enable CoS. Currently that could be:
Comment 4 Jaroslav Tulach 2016-06-10 09:11:14 UTC
Created attachment 160026 [details]
Replacing .netbeans* files with a query like approach

I am not really satisfied with 

I believe this patch better suites the over NetBeans project philosophy: ask a query and give the projects an ultimate control over the final decision.

I believe that existence of $cos.update property is a great indicator of the user will to really enable CoS.
Comment 5 Jaroslav Tulach 2016-06-10 09:13:04 UTC
With the attached patch, it is enough to use just and get reasonable CoS behavior for all mx based projects.
Comment 6 Jaroslav Tulach 2016-07-22 09:24:49 UTC
Tomáši, I know you were working on "ResourceSet" that could be used from the Ant task to copy the class files/resource files. Can you update this issue with information about such enhancement? Thanks.
Comment 7 Tomas Zezula 2016-08-11 15:18:58 UTC
Created attachment 161629 [details]
Proposed patch
Comment 8 Tomas Zezula 2016-08-15 12:28:16 UTC
Created attachment 161664 [details]
Proposed patch

Patch with FileBuiltQuery.
Comment 9 Tomas Zezula 2016-08-15 14:31:59 UTC
Fixed jet-main 4c7e68ea7d33
Comment 10 Jaroslav Tulach 2016-08-23 15:38:01 UTC
I wrote some documentation at
Comment 11 Tomas Zezula 2016-08-25 05:11:37 UTC
Thanks a lot Jardo!
BTW: Any idea about the unexpected changes?
Comment 12 Quality Engineering 2016-08-27 02:18:50 UTC
Integrated into 'main-silver', will be available in build *201608270002* on (upload may still be in progress)

User: Tomas Zezula <>
Log: #252595:Missing "onsave" project hook for J2SE Ant build.xml