NAZEHA
NAZEHA

Reputation: 455

spring boot: create multiple context for the same application-context.xml

I need to create multiple context for the same application context.xml file and each context use its own application.properties.

How to do it using spring boot ?

I have 3 clients who have the same behaviour but each one with specific details declared into client-application.properties.

So i use also spring integration and the flow will be reused for each client . I need to launch 3 clients in the same time and each one with its own application.properties. And i use xml for that.

Upvotes: 1

Views: 1743

Answers (1)

imTachu
imTachu

Reputation: 3809

Take a look at this... I have a single project, and inside of it are three application.properties (or the number you need)

in application.properties, i specify general parameters

enter image description here

and in each application-.properties i specify specific environment properties, e.g., the port in production:

enter image description here

And the port for my dev profile:

enter image description here

In order to use them check the documentation that Ivaylo recommended

...A small example:

enter image description here

In this case, the application will boot on the port showed in the different .properties files.

You can specify the profile like: mvn spring:boot run -Dspring.profiles.active=dev

Upvotes: 1

Related Questions