Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nb-configuration.xml settings are ignored for gradle projects #8356

Open
redsaz opened this issue Mar 21, 2025 · 0 comments
Open

nb-configuration.xml settings are ignored for gradle projects #8356

redsaz opened this issue Mar 21, 2025 · 0 comments
Labels
Gradle [ci] enable "build tools" tests kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@redsaz
Copy link

redsaz commented Mar 21, 2025

Apache NetBeans version

Apache NetBeans 25

What happened

While in a gradle-based project, I try to set project specific settings. However, this persists the settings into gradle.properties, which is not desirable because I'm the only Netbeans IDE user in the codebase, and the project is IDE-agnostic and so I do not want to save these settings in gradle.properties.

I thought I could work around this by bringing in an nb-configuration.xml file (which can then be gitignored) with the settings specified there. However, it appears the file is ignored completely.

Language / Project Type / NetBeans Component

NetBeans project specific settings (specifically gradle projects)

How to reproduce

  1. Open a gradle-based java project
  2. Make a project-specific setting by going to File -> Project Properties
  3. (Optional, has no desired effect) Go to Build -> Gradle Executions and uncheck Augmented Build Execution, with the hope that this won't cause changes to gradle.properties for IDE-specific settings
  4. Go to formatting, click the "Use project specific options", change some value away from the global value (I switched from Right Margin of 80, to 100)
  5. Hit Ok

Expected behavior:

The settings are put into nb-configuration.xml, as witnessed in other projects. Or, there is somehow an option for not storing the IDE-specific settings in gradle.properties.

Actual behavior:

The settings are stored in gradle.properties, which is undesired for a project that is IDE-agnostic and where I'm the only one using Netbeans IDE

Alternatively, try bringing your own nb-configuration.xml:

  1. Open a different java project (maven-based can work)
  2. Follow the above steps to create a project-specific nb-configuration.xml file for that project
  3. copy the resulting nb-configuration.xml file into the gradle-based project
  4. delete the IDE-specific settings from gradle.properties, save.
  5. restart Netbeans IDE
  6. Change a file where you can observe if the project-specific formatting config works or not when the format action runs

Expected behavior:

The format action will format the document according to the project-specific setting as specified in nb-configuration.xml.

Actual behavior:

The format action behaves as if nb-configuration.xml doesn't exist, and uses the global formatting options.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Fedora 41

JDK

21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Workarounds:

  • Try to remember not to commit gradle.properties
  • Or, do not use project specific settings, make the changes in the global settings, and do not work on other projects that have different formatting requirements while working on the project
  • Attempt to change project policy (allow IDE-specific settings in gradle.properties, or try to change the project guidelines to adhere to other project guidelines, etc)

Backstory: I'm the only Netbeans IDE user on a coding project, and the project is IDE agnostic so no IDE settings are stored in the code repo, and the project uses gradle. I don't want to accidentally commit changes for gradle.properties that don't actually relate to the build, so I can't use git add -a to add all the files like I like.

(This may conflict with #1116, unsure)

I've used Netbeans with maven for many years, and recently got into a project that uses gradle, so I've not observed this problem before. Otherwise I've been happy with Netbeans, thank you for the project!

Are you willing to submit a pull request?

No

@redsaz redsaz added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Mar 21, 2025
@mbien mbien added the Gradle [ci] enable "build tools" tests label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gradle [ci] enable "build tools" tests kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

2 participants