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.
In AntActions.doProfileProject, if ptp.startProfilingSession returns false, NetBeansProfiler.runTarget is called which ultimately calls ActionUtils.runTarget. But first it calls 1. RerunAction.get(RerunAction.class).updateAction() 2. [sometimes] HeapDumpWatch.getDefault().monitor(....) These steps are apparently skipped in case sPS returns true, as I presume it would in the case of Maven profiling integration.
There's no problem here, the code works as designed. The ProjectTypeProfiler.startProfilingSession has been recently added as a workaround for experimental Maven support which skips starting profiling via Ant, just don't use it if you don't need it or return false. It's no public API to be used by other modules. If you add your module as a friend and something doesn't work, it would probably be more convenient to file a RFE if you need some extra functionality or at least contact the developers instead of filing defects. FYI, for some of the upcoming NetBeans releases we are planning to introduce some kind of general profiling API/framework similar to debugger API. We will appreciate any feedback and ideas on possible features etc. - integration with a generic Project will certainly be one of the features.
I asked for information in issue #142284, but there was no response. (Sorry but I have no idea who works on the profiler these days so my only channel of communication is Issuezilla.) Anyway I think I have enough working - see issue #144921. There are a lot of packages exposed to friends and it took a while to decide that I could ignore nearly everything except ProjectTypeProfiler; even this interface has a lot of methods which do not seem like they are necessary - perhaps it could be split up into a set of optional services or something like this. So for Maven profiling it is intentional that RerunAction action does not get updated and there is no heap dump watch? Just curious; these things don't look to be related to Ant vs. Maven (just judging by the names). I don't know enough yet about Profiler internals to give detailed feedback about a new API. What is most confusing is that for every other kind of project action you use ActionProvider to define what the project can support, yet for the profiler there is a completely unrelated friend SPI. This seems odd since you would expect that running, debugging, and profiling would just be minor variants of the same action. Also as mentioned in issue #142284, there is no apparent Quick Profile action integrated with CoS (I had to make my own for autoproject.profile).