I have a pretty simple Springboot project that taps into the DAO with a local in-memory H2 database if running JUnit. I have 2 configuration files, application-local.properties
and application-TEST.properties
. There is a DataSourceProvider class that has property holders such as:
@Value("${spring.datasource.schema}")
String dbSchema;
@Value("${spring.datasource.url}")
String dbUrl;
...
These properties get loaded perfectly fine when running the SpringBoot main class and hitting an endpoint and when running the DAO layer JUnit test, however when I do mvn clean install
, it's telling me:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.schema' in value "${spring.datasource.schema}"
I've spent awhile now and I can't figure out why this is happening?