There are a few possible solutions to this issue:
Create a separate properties file: Instead of using the default application.properties file, create a separate file (e.g. config.properties) with the same properties and put it in a different directory. Then, update the Spring Boot configuration to use this file instead of the default one.
Add the file to the classpath: Another solution is to add the application.properties file to the classpath explicitly. In Eclipse, you can do this by right-clicking on the project, selecting Properties, then Java Build Path, and then adding the file to the Source tab.
Check for file permission issues: Ensure that the application.properties file has the right permission settings so that it is not deleted or modified without permission. This can be done by checking the file permission settings on the file system.
Re-import the Maven project: Try to re-import the Maven project and make sure that the application.properties file is included in the project structure. To do this, right-click on the project, select Maven, then Update Project, and then follow the steps in the update wizard.
Use a version control system: Use a version control system such as Git to manage changes to the application.properties file. This way, even if the file is accidentally deleted or overwritten, it can be easily restored from the repository.
Asked: 2023-01-03 11:00:00 +0000
Seen: 9 times
Last updated: Jul 01 '21