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 238035 - Globally disable "Compile on Save" for Maven
Summary: Globally disable "Compile on Save" for Maven
Status: NEW
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-06 10:41 UTC by jmborer
Modified: 2015-04-01 12:18 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmborer 2013-11-06 10:41:48 UTC
I am having often trouble running Tests when "Compile on Save" is turned on. It happens when the JVM tries to load a Service provided in a dependent Jar.

More over I get those warnings:

Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.

So, I am really wondering why it is now turned on by default? When error occur, it is quite difficult the first time to find out the reason and how to fix it. Then you have to turn the option off for every single Maven project. Very annoying...

My suggestion would be to provide an option in "Options->Java-Maven" where you could turn off the "Compile on Save" globally.
Comment 1 jmborer 2013-11-06 10:43:13 UTC
Very annoying indeed. I am raising the priority level to 2.
Comment 2 Milos Kleint 2013-11-06 12:12:41 UTC
you can turn off CoS by the moving of the relevant property in nb-configuration.xml file into the parent pom (to disable in a group of projects) or into ~/.m2/settings.xml (to be global). As in written in the  nb-configuration.xml file.

The property here is:
<netbeans.compile.on.save>none</netbeans.compile.on.save>

"Running NetBeans Compile On Save execution...." is not really a warning, it's just a reminder that indeed the build is running with CoS and if there are problems, you should disable it. That's why it shows on every execution.

The problems mostly result from the setup of the project (not saying the setup is wrong, just that some setups are not supportable) and are not identify-able up front by us (it's often related to how the runtime environment deals with classpath etc.
Comment 3 jmborer 2013-11-06 13:05:29 UTC
(In reply to Milos Kleint from comment #2)
> you can turn off CoS by the moving of the relevant property in
> nb-configuration.xml file into the parent pom (to disable in a group of
> projects) or into ~/.m2/settings.xml (to be global). As in written in the 
> nb-configuration.xml file.
> 
> The property here is:
> <netbeans.compile.on.save>none</netbeans.compile.on.save>
> 
> "Running NetBeans Compile On Save execution...." is not really a warning,
> it's just a reminder that indeed the build is running with CoS and if there
> are problems, you should disable it. That's why it shows on every execution.
> 
> The problems mostly result from the setup of the project (not saying the
> setup is wrong, just that some setups are not supportable) and are not
> identify-able up front by us (it's often related to how the runtime
> environment deals with classpath etc.

One thing that doesn't work for example is when a I provide a new JMX implementation: remote optional. JMX will discover it through ServiceLoader. With CoS, it will fail by complaining that it couldn't find the required service.

Thanks for the tip of the property. One idea then would be to document it better, say for example when you display the warning. You might suggest this option or in the Maven options panel. Of course, only NB will use the property. It won't have any effect on Maven.
Comment 4 Milos Kleint 2014-01-20 13:38:46 UTC
related, duplicate of issue 227791 I suppose
Comment 5 jmborer 2014-01-20 13:45:51 UTC
Somehow, yes.