Strange behavior of STS 4.9.0 with Spring Security importation and Gradle synchronization
See original GitHub issuePlease consider this how a strange situation, not sure if is a bug
I spent some days trying to find a solution and nothing. I do not post this in StackOverflow because is not a specific technical question and is a perfect candidate to be closed quickly by its moderators
I have STS 4.9.0 installed in
- Mac (El Capitan)
- Windows 10
Both PCs have the same configuration, about JDK versions (8,11,15 - included STS) and all plugins (all of them currently updated)
Practically for each project, I create a dedicated workspace, for example, one for Spring Integration, Spring Boot, Hazelcast etc … it for custom isolation for the local repositories.
Now, something important, I only have one STS installation and each workspace is started through command with:
$STS_HOME/SpringToolSuite4.app/Contents/MacOS/SpringToolSuite4 -data ${WORKSPACE_DIRECTORY} -vmargs -Xms512M -Xmx4G
Two weeks ago, I cloned and imported the Spring Security
project (based on Gradle) into STS - for contribution purposes, it worked in peace for short time, but suddenly it stop to work, it does not open as is expected anymore. Even when I deleted the workspace directory (goodbye .metadata
directory and the project itself) and repeat all the steps for importation purposes:
- create new workspace
- git clone
- git remote add REMOTE_URL
- git fetch upstream
- git merge upstream/master
happens the following:
It loads as follows (does not show each sub module)
If I delete the project from the workspace as follows:
Therefore the workspace is empty, as follows:
So, if I close and open the IDE loads as follows, shows the sub modules but not how should be (Figure Alpha):
If I do the following (it after to be built the project by the console/terminal)
Gradle
->Refresh Gradle Project
Arises the following error:
Note: I reported this error to Buildship, but now here, because in Windows all work fine
And then the project structure changes as follows: (btw - compare against Alpha):
If I again do Gradle
-> Refresh Gradle Project
happens again
Now, Spring Security asks for Java 8 and the STS comes with JDK 15. In the previous figures, for the imported project, it always has itsJRE System Library
by default pointing to 15, even having the STS configured to work with JDK 8 (figures about this later). Therefore from the beginning and always (even in Windows) the imported project has/targets to JRE 15 by default.
Observation: (delta scenario) something interesting, if create a new workspace from the scratch, and prior to import the project, I delete the included JDK 15, with the importation and with Gradle
-> Refresh Gradle Project
, all happens again about the error, and the imported tries to refer the JDK 15 (shows an error because does not exist - it was deleted)
My IDE global or Preferences configuration for Java 8 is as follows (here JDK 15 exists, but is ignored)
So, after to import the project, I change all manually from JDK 15 to 8 as follows:
So, if in this point If I do again Gradle
-> Refresh Gradle Project
appears the message error, and the project refers again to JDK 15, so the previous configurations from JDK 15 to 8 are totally reseted - even if the delta scenario was applied or not.
So:
- Why the project always tries to refer to JDK 15?, even if was deleted prior to import the project.
- Why appears that error message when Gradle tries to synchronize? and how to fix it?
Note this problem happened suddenly I am absolutely sure that I did not do an update to the Buildship plugin. And like I said, all work (for the moment) in Windows 10
Note I execute all the Gradle tasks commands by console/terminal because I am able to apply later (.gradlew --stop
). STS creates its own Gradle Daemons that only appears with the jps
command, I am going to create other issue about this to ask for that STS includes a new view to show its own Gradle Daemons and let the developer to stop it.
Your experience and guidance is extremely valuable.
Thanks for your understanding
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@manueljordan First of all, thanks for sharing all the details here with the community and glad to hear that you found a way to make this work again. I am also wondering why the presence of the
spring-javaformat
plugin causes this, so will need to do a bit of investigation on this.Hi @martinlippert , remember I got an error from the beginning with the creation/importation of that project for a new and custom workspace, then I installed the plugin thinking that was mandatory. But that did not work. The details are in that link.
Thanks for the support in advance.