Categories
java maven spring spring-boot

Configure active profile in SpringBoot via Maven

I’m trying to set an active profile in Spring Boot application using Maven 3.

In my pom.xml I set default active profile and property spring.profiles.active to development:

<profiles>
<profile>
<id>development</id>
<properties>
<spring.profiles.active>development</spring.profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>

but every time I run my application, I receive the following message in logs:

No active profile set, falling back to default profiles: default

and the SpringBoot profile is set to default (reads application.properties instead application-development.properties)

What else should I do to have my SpringBoot active profile set using Maven profile?

Any help highly appreciated.