Intellij remove resource files before running/debugging
已回答
Currently, I'm using Intellij 2021.3 with education license.
Usually, when I debug project spring boot with intellij, there is error: Failed to parse configuration class [com.example.lmsbackend.LmsBackendApplication]; nested exception is java.io.FileNotFoundException: class path resource [flyway-config.properties] cannot be opened because it does not exist.
I check files generated in target folder, there are only remainning class file and there is no resouce file like applications.properties, flyway.properties... but these file are generated when I run mvn clean install

Please help me. Thank you.
请先登录再写评论。
I found this thread, but it seems not work for me.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360005005559--Spring-Boot-Resources-directory-not-available-in-out-path-Application-yml-and-properties-files-are-not-found-
>I check files generated in target folder
Where is it located in project? Please attach screenshot showing it in project tool window. If this is a generated file, please describe how you generate it. Do you use Maven or Gradle in project?
It would help to better understand the issue if you describe steps to reproduce after after which it happens. And would be the most helpful to get a sample project. For uploading you can use https://uploads.jetbrains.com service. Thank you.
I'm using maven as build tool, and below is the project tool window. You can see, there is missing V1_2__init_table.sql in the target folder. This happens often when I click on debug icon in intellij.
This is my run/debug configuration. sorry but I cannot upload my project. And one more points: my colleagues don't have this scenario like me. I don't know why, maybe the reason is my computer?
When I run mvn clean install, the target folder is correct, it contains all file in resources folder.
But when I click debug icon, these resource files are removed before intellij start debugging, it happens often, not always.
>You can see, there is missing V1_2__init_table.sql in the target folder.
I see that you have the target/classes directory marked as generated sources. This is strange configuration and may be the cause of the problem. Why do you have it marked as generated? Have you made this configuration in the Maven?
>And one more points: my colleagues don't have this scenario like me. I don't know why, maybe the reason is my computer?
Most likely the structure of you project was incorrectly confiugred. You can try to delete existing `.idea` project configuration directory and re-import project from scratch using File | New | Project from Existing Sources... action.
I will unmark class folder and test. Thank you for you answer. :D
It seems to be working fine. Thank you very much.
Great! Thanks for the information.