I need to use a application.properties file to define a DataSource in a Spring Batch application.
When I execute the generated spring boot runnable jar, the application.properties in the resource folder is used correctly and the DataSource is created accordingly to the definition in application.properties.
But, when a use the CommandLineJobRunner class to run my job I get a dependency injection error because the spring could not find the DataSource bean.
I have tried to put the application.properties in the classpath, in the same folder where I am executing the CommandLineJobRunner and in a config folder. None of that have worked.