> unfortunately, once again STS started to refresh the dependencies of some projects
It was a long shot anyway. I as thinking it may have been some OSGI state got messed up that interferes with the plugin loading. Was worth a try.
> for the same projects, the Package Explorer, instead, does NOT show any library (apart from the "JRE System Library")
I have noticed this kind of thing also. If you happen to open a project before the container has been initiallized the package explorer won't show it. I think this is just an odd UI glitch in the package explorer view. Nothing to be concerned about. I think it simply doesn't bother displaying empty containers.
Once the container is initialized. I found I have to 'refresh' the package explorer by right click on the project node (for example) and select 'Refresh'.
> However, there's one thing I haven't fully understood yet: when STS launches the Gradle API to refresh one project dependencies, does it actually refresh the dependencies for ALL the projects in the same Gradle multiproject?
Yes, and no. The underlying models that are used to populate the classpath containers are refreshed as a group, but the contents of each individual container is refreshed individually by JDT.
This is because JDT manages the classpath containers and when to initialize them etc. So they get called when JDT decides it needs them, and I don't have much control over that.
But the underlying Gradle model are very expensive to build and when you build the model for a multi-project you are actually building the models of all the projects in the multi-project. So whenever needing to build the model of a project say X, I also pro-actively insert all the related project models into project->model cache.
This in itself will not cause the related project's classpath to update however.
Nevertheless, I think it is possible that refreshing one project will trigger the update of a related projects contents as well. That is because if a project say 'core' is refreshed then JDT will probably also decide to refresh the classpaths for projects that depend on 'core'.
But, these secondary refreshes should be 'cheap' and shouldn't result in an additional gradle model build, because the related models will already have been pre-cached.
Some extra info since my last post: I have also recently seen refreshes happen on startup that I think shouldn't happen, but so far I still can't reliably reproduce it. I.e. I have actually seen it happen once when opening an old workspace I hadn't used in a while but can't find a reliably method to reproduce that behavior in a 'controlled' and 'fresh workspace' environment.
Anyway, I'll work a bit today on replacing the internal JDT api I used for getting persisted values to something custom implemented. Hopefully that will make things work more reliably. I'll let you know when there's something for you to try.