0

I have a Spring Boot application with Spring submodules as dependencies. I start the application using Spring Boot Maven Plugin like this:

mvn spring-boot:run -Drun.profiles=foo,bar

For me it seems like the submodules don't receive the active profiles foo,bar.

Is it possible to pass over Spring profiles to Spring submodules?

Farkas István
  • 504
  • 2
  • 5
  • 15
  • What do you mean with "submodules"? Are they just Maven modules, which are added as dependency to your main application? In that case, the profiles are active for them, because the modules are just a way of structuring the classes (in JARs), they don't have their own runtime or environment. – dunni Apr 23 '16 at 09:33
  • Yes, I mean Maven modules as dependencies in my app. I got the answer. Is it possible to add an other Spring Boot application as a Maven dependency? Thank you for your answer. – Farkas István Apr 23 '16 at 09:41
  • You can do that, but that it's just a dependency. That doesn't mean, that the second application will also be executed. If the component scanning will include those packages, the configuration classes will be scanned though, and the beans created. – dunni Apr 23 '16 at 10:04
  • Thank you for your help! – Farkas István Apr 23 '16 at 14:47

0 Answers0