Skip to content

NBM project properties window: evaluate javac.release properties#9323

Draft
mbien wants to merge 1 commit intoapache:masterfrom
mbien:nb-project-javac-eval
Draft

NBM project properties window: evaluate javac.release properties#9323
mbien wants to merge 1 commit intoapache:masterfrom
mbien:nb-project-javac-eval

Conversation

@mbien
Copy link
Copy Markdown
Member

@mbien mbien commented Apr 4, 2026

NBM project properties window now evaluates the javac.release property to get its value.

this should allow something like:

javac.release=${default.javac.release}

in the [module]/nbproject/project.properties file (assuming it can be resolved)

tested:

added default.javac.release=18 to nbbuild/user.build.properties and updated a module like described above. This got picked up by both the build and the project properties window UI.

this might be the easiest way to set a default value for modules. I tried to find a way to allow removal of the property entirely (as signal to use the default), but I couldn't get that to work.

NBM project properties window now evaluates the javac.release property
to get its value.

this should allow something like:
javac.release=${default.javac.release}
(assuming it can be resolved)
@mbien mbien added this to the NB30 milestone Apr 4, 2026
@mbien mbien added Ant [ci] enable "build tools" tests build ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Apr 4, 2026
@neilcsmith-net
Copy link
Copy Markdown
Member

I think this makes sense, at least as an immediate fix. Aligns more with changes you made at https://github.com/apache/netbeans/blob/master/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProject.java#L693 Not sure if that could easily be just in one place? The project properties are constructed with a reference to NbModuleProject.

What didn't work trying to set a default? The build, the editor, the UI ?? The default properties fallback seems a bit suspect in all this https://github.com/apache/netbeans/blob/master/apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java#L133

@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 13, 2026

The default properties fallback seems a bit suspect in all this

the ant evaluator itself also sets defaults at

defaults.put(SingleModuleProperties.JAVAC_SOURCE, "1.4"); // NOI18N

if we wanted to set a default for NB, where would we put it? build.properties isn't in the context of the evaluator.
e.g setting a breakpoint at

and running evaluator.getProperty("bootstrap.jdk.release") returns null.

nbbuild/user.build.properties does work, but is currently not used and on the gh ignore list.

@neilcsmith-net
Copy link
Copy Markdown
Member

I guess perhaps considering putting build.properties in the evaluator context?! Or understanding why it was left out. And also looking at what defaults get set via XML. Having different defaults in 15 different places isn't great! 😄 The UI needs to reflect the build. Which relates back to your earlier issues on #5455

Anyway, that's not one to experiment with in freeze week. This seems a good change for now.

@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 13, 2026

we can move it to NB 31. Since without being able to set the default somehow, this has no real use case.

@mbien mbien modified the milestones: NB30, NB31 Apr 13, 2026
@mbien mbien marked this pull request as draft April 14, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ant [ci] enable "build tools" tests build ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants