GitHub user pratikrath126 added a comment to the discussion: How do you check if compileOnSave is on for a Project
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: 1) Detect project type (ProjectType, lookup). 2) For Ant/Java SE, read the project properties (e.g., compile.on.save). 3) For Maven, check nb-configuration.xml (or use ProjectConfiguration) for NetBeans-specific settings. 4) For Gradle, treat it as unsupported by NetBeans CoS and assume false unless you find a plugin-specific flag. So short answer: no single API; you’ll need to branch by project type and read the relevant project metadata. Hope that helps! GitHub link: https://github.com/apache/netbeans/discussions/9218#discussioncomment-15887881 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
