apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.62k stars 841 forks source link

Gradle stores some settings into .gradle which are later marked by MS Java Ext pack as modified project #5520

Open MartinBalin opened 1 year ago

MartinBalin commented 1 year ago

Apache NetBeans version

Apache NetBeans 17 release candidate

What happened

Created Gradle project with subprojects using VSNetBeans 16.0.301 and OCI tooling. This is done in coexistence with MS Java Ext Pack (JDT). Later MS Java reports as problem that Gradle project files was modified and needs to be reloaded to make it effective. It looks like some recent change or regression on NBLS side.

Screenshot 2023-02-17 at 9 56 59

It is not shown when project is open for 2nd time, just after its creation when OCI powered Vulnerabilities audit completes. Using VSNetBeans 16.0.301

How to reproduce

No response

Did this work correctly in an earlier version?

Apache NetBeans 15

Operating System

macOS

JDK

GraalVM 22.3.0 JDK17

Apache NetBeans packaging

Apache VSNetBeans for VSCode

Anything else

No response

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

sdedic commented 1 year ago

This was caused by setting project auxiliary properties that Gradle module maps to file .gradle/nb-cache/<project-id>/gradle.properties.

The MS seems to consider all files with gradle-like names (i.e. gradle.properties, settings.gradle, ...) in all subdirectories as part of the buildscrips, although their directory is not enumerated as a subproject.

@lkishalmi An idea: could we change the name (while preserving compatibility !! with existing projects) of the project auxiliary settings slightly ? Something like gradle-nb.properties, or gradle-aux.properties ... I suspect that more projects may have some issues with this, as it is really not that easy to recognize what is a proper subproject and what is 'just a directory'.

lkishalmi commented 1 year ago

Well, have to add some code to do the migration from old names to the new ones, but certainly possible.