sts4 icon indicating copy to clipboard operation
sts4 copied to clipboard

Java tooling in VSCode doesn't re-validate Java sources after migrating to newer Spring Boot

Open martinlippert opened this issue 2 years ago • 2 comments

When upgrading a Spring Boot project in VSCode using the Spring Tools upgrade support to jump to Spring Boot 3.1 (for example), the updated Java sources are not validated again after the project itself got updated somehow.

When I upgrade a project from Spring Boot 2.7.x to 3.1 which has references to javax (which gets converted to jakarta packages), the import statements as well as the pom file gets updated correctly, but the problems view in VSCode shows errors for those import statements in the Java sources (can't resolve the import). As soon as I open the Java source file, the error disappears from the problem view. Looks like there is some reconciling or re-validation missing on the Java side or it happens at the wrong moment in time (after the source code changes, before the pom changes and new dependences got updated internally inside of the Java tooling)

martinlippert avatar Jun 15 '23 12:06 martinlippert

It has something to do with that mechanism in vscode that open resource in the editor once it receives changes.

The workaround is save currently opened file (save the pom first) and then save all.

BoykoAlex avatar Jun 15 '23 13:06 BoykoAlex

The only editor that I have open is the one for the pom.xml file. I also have Auto-Save enabled. After running the upgrade, there are no other editors being opened or anything like that. Also the Save all menu item is disabled, so nothing to save.

martinlippert avatar Jun 15 '23 14:06 martinlippert