How do you check if compileOnSave is on for a Project #9218
-
|
is there a one-shot api that can tell you if a given project has compileOnSave "effectively" enabled? like taking into consideration maven properties, maven properties of the parent pom, nb-configuration.xml stuff or the "type of java project" (gradle, maven, ant) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey! In NetBeans, there isn’t a single public “one-shot” API that returns the effective compileOnSave for every project type. The setting can come from project metadata (nb-configuration.xml / project.properties) and also be overridden by build tooling (Maven/Gradle/Ant). For Maven projects, NetBeans generally relies on the maven-compiler-plugin and its own project configuration; the effective value is usually stored in nb-configuration.xml or nbactions.xml rather than being computed from the POM. For Ant-based projects, it’s typically a project property. For Gradle, it’s mostly controlled by the Gradle tooling, not NetBeans. If you need a reliable check, the practical approach is:
So short answer: no single API; you’ll need to branch by project type and read the relevant project metadata. Hope that helps! |
Beta Was this translation helpful? Give feedback.
Hey! In NetBeans, there isn’t a single public “one-shot” API that returns the effective compileOnSave for every project type. The setting can come from project metadata (nb-configuration.xml / project.properties) and also be overridden by build tooling (Maven/Gradle/Ant).
For Maven projects, NetBeans generally relies on the maven-compiler-plugin and its own project configuration; the effective value is usually stored in nb-configuration.xml or nbactions.xml rather than being computed from the POM. For Ant-based projects, it’s typically a project property. For Gradle, it’s mostly controlled by the Gradle tooling, not NetBeans.
If you need a reliable check, the practical approach is: