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

Refresh Gradle Project does not refresh Project and External Dependencies container if .classpath or .project is read-only #985

Open
eric-milles opened this issue Apr 15, 2020 · 4 comments

Comments

@eric-milles
Copy link

eric-milles commented Apr 15, 2020

Expected Behavior

After triggering Gradle > Refresh Gradle Project the contents of Project and External Dependencies are refreshed.

Current Behavior

If the project's .classpath or .project files are read-only -- for whatever reason, like they're in source control for example -- the refresh action/command stops after classpath and project merge steps, without updating the classpath container.

Context

Changed dependency version in build.gradle and that library was not updated in the project's classpath.

Steps to Reproduce

Create a basic gradle project, change the file attributes (Alt+Enter) for .classpath and .project to read only. Change version of a dependency in build.gradle. See the Project and External Dependencies container.

Buildship version is 3.1.3

@donat
Copy link
Contributor

donat commented Jan 29, 2021

Does anything work if the .classpath file is read-only? I assume you cannot modify anything classpath-related, can you?

@eric-milles
Copy link
Author

.classpath and .project are locked by source control. Unlocking for modification creates possibility of accidental commits. Looking for a solution where the libraries are refreshed, which does not require any change to project or classpath XML.

@donat
Copy link
Contributor

donat commented Feb 24, 2021

I don't know how to deal with this. I've tried locally (on macOS) and for me, the .project and .classpath was refreshed even when I've made the files read-only.

My understanding is that the Eclipse APIs setting project names, classpath entries, etc require editing of those descriptors. Making the descriptors read-only would make Eclipse unusable. I might be wrong though, so if you have a better idea of how to modify the updater classes (e.g. this one) let me know.

@eric-milles
Copy link
Author

We have had .classpath and .project in source control and read-only for 10-ish years. Eclipse does not need to write unless you interact with Build Path or other project properties dialogs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants