79737578

Date: 2025-08-17 01:08:50
Score: 2
Natty:
Report link

Solution
After running the application in different code editors. I realized the issue was VSCode itself.

The Java extension Eclipse JDT Language Server maintains its own Java workspace and can run background incremental builds or config updates. For Maven projects that use annotation processors, those background actions may clean or recompile target/, removing generated classes.

To make maven handle the entire process, include the following settings in .vscode/settings.json

{

  // avoid background incremental builds that mutate target/
  "java.autobuild.enabled": false,

  // don’t auto-apply build config changes
  "java.configuration.updateBuildConfiguration": "interactive",

  // prefer using your Maven Wrapper for explicit builds
  "maven.executable.preferMavenWrapper": true
}

Then, clean the existing Java Language Server Workspace by running Java: Clean Java Language Server Workspace in command palette.

Finally, restart the VSCode window by running Developer: Reload Window in command palette.

P.S. Wow! two downvotes and not a single answer. I just remembered why no one uses this site anymore...

Reasons:
  • RegEx Blacklisted phrase (2): downvote
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Javs