I am running into problems when using IntelliJ for Spring development. At first, the IntelliJ build command works fine and picks up changes I make to the source code. At some point, this stops working and I can only compile my sources through maven, as the build or rebuild project commands seem to do nothing anymore.
I am confused, as it works as desired at the start but then stops working at some point.
Steps to recreate:
Create a new Spring project using Spring Initializr:
curl https://start.spring.io/starter.zip -d type=maven-project -d javaVersion=11 -o demo.zip && unzip demo.zipStart IntelliJ from the command line in that folder, this will auto-import the project:
idea64 .Write a log message in the main class and run the project using
Run->Run 'DemoApplication'. This compiles the sources to thetargetfolder and starts up the project. You should see the log messageAlter the log message, run again and the changes should be visible (so far so good)
Now re-compile the sources via maven command
mvn compileand restart IntelliJFrom now on, running
buildorrebuild projectwithin IntelliJ will not pick up any changes I make to any of my source files. In fact both commands don't seem to do anything at all. I have to compile via maven in order to properly compile my sources
I tried a few things to overcome this problem, but without success:
- Invalidated caches/restart
- Checked
project settingsforProject Compiler Outputand set it to<project-folder>/target - Checked
project settings/modulesforoutput pathandtest output pathand put in the path as above - Used
Reimport All Maven Projects - Deleted the
.ideafolder within the project folder. This seems to work, but is very inconvenient and surely no intended behavior. Also it breaks again if I recreate the steps detailed above.
Is anyone experiencing similar problems and/or has a solution?
