Search code examples
javaspringmaven

How to activate Maven profiles with Spring pr


Suppose I have two Spring profiles - A and B - and two Maven profiles - similarly A and B. Is there a solution to activate Maven A profile when the Spring application is launched with A profile? In other words, how to manage Maven profiles with Spring profiles? This question is the opposite


Solution

  • From my understanding, it is not possible nor does it make sense. Maven is a build tool, and thus finished its work long before your Spring application even starts.

    What's your use case why you want to do that? Maybe if we understand that, we can give you a more helpful answer.