Reputation: 4932
I'm struggling with application.properties setup in maven multimodule project. I have structure
--parent
----core-api
----infrastructure (infrastructure.properties)
----command
----web (application.properties)
I'm using different names for appliaction.properties, because I want to load them all in target module.
I've read this and this posts so I decided to put
@PropertySource(value = { "classpath:application.properties","classpath:infrastructure.properties" })
to my Application.class in web module. But when I run command mvn spring-boot:run from my parent project I get exception:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.github.bilak.axonframework.poc.Application]; nested exception is java.io.FileNotFoundException: class path resource [infrastructure.properties] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:180)
my project can be found here
Thanks in advance
Upvotes: 3
Views: 3631
Reputation: 33101
You could reuse Spring Boot infrastructure instead of doing your own thing. You could have applications-infrastructure.properties
and enable the infrastructure
profile.
Regarding your second question, no you should install the other modules first; you can also find a related discussion in #3436
Upvotes: 1