I am building a Spring application with the use of maven.

In my application, I have two implementations (java classes) of one interface and want to use one of them, depending on the profile that I define during app building. Each of these implementations is in its separate app maven module. When building an application, I want to include in a war file only this one selected implementation.

When it comes to using the selected class, I have an idea to refer to some variable (defined in the profile in the <properties> section) in the application so as to get to know the choice and thus - use selected implementation.

When it comes to including in war only the selected class, I have no idea how should I do it. I am a beginner, have read this introduction to profiles but still don't know how to make it.

有帮助吗?
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top