I have file src/main/resources/dev/important.properties where in fact 'dev' is one of Spring profile names I use. Somewhere in application this file is referenced as:
@PropertySource(value = "classpath:important.properties")
When I run in Intellij:
mvn spring-boot:run -Dspring-boot.run.profiles=dev
I get FileNotFoundException upon application start. If I move file one level up (to src/main/resources) it works. I can say no surprise here. How to add src/main/resources/dev to classpath so this file would be visible in this directory? This stuff is needed only for local development (Maven+Intellij and dev profile) and it's excluded from runnable jar. I do not want to modify @PropertySource
expression.