Relative Content

Tag Archive for javamavenproperties

Loading properties files from a 3 module maven project

I have been encountering an issue where AnsibleConfig.java, located in the commons module, is not being properly initialized or accessed during tests in the main module of your Spring Boot application. Despite configuring @SpringBootTest with @ActiveProfiles(“test”), and ensuring application-commons.properties is correctly placed in src/test/resources of the commons module, AnsibleConfig.java remains null during test execution. The main module runs the Spring Boot application with its @SpringBootApplication class and public static void main method, while other modules like commons provide configurations. Despite these configurations, AnsibleConfig.java fails to initialize properly in tests and its probably user error.