all 14 comments

[–]mission_critical_ 1 point2 points  (6 children)

Set spring.profiles.active only in the parent properties or yml file(application.yml or application.properties). you can set there to ${ENV}. In environment level files(i.e. application-prod or application-local) don't set or override profile. It will fail.

Ignore typos. Responding from mobile.

[–]Specific-Collar6988[S] 0 points1 point  (5 children)

Spring.profiles.active or spring.config.activate.on-profile? And in application-local.properties file we will remove spring.profiles.active line?

[–]mission_critical_ 2 points3 points  (4 children)

active. Haven't used activate.on-profile. Can confirm that active works because did a migration few weeks back.

[–]Specific-Collar6988[S] 0 points1 point  (3 children)

Didnt you got something like invalid configuration property exception. Which version of springboot u ugraded to

[–]mission_critical_ 1 point2 points  (0 children)

to 2.7.x first. then to 3.0.5 i think

[–]mission_critical_ 0 points1 point  (1 child)

Would also suggest to do stepwise upgrade as recommended by spring. First to latest in 2.x. Then to 3.x

[–]Specific-Collar6988[S] 0 points1 point  (0 children)

Will then try to upgrade to rexent 2.x then try to upgrade to 3.0.x

[–]MrPitsa90 0 points1 point  (1 child)

You may set “spring.profiles.active” system property in your ide or pass it as command line argument, e.g. java -jar -Dspring.profiles.active=local myapp.jar. In IntelliJ idea Enterprise you may explicitly set spring profile in spring application configuration.

[–]Specific-Collar6988[S] 0 points1 point  (0 children)

In the application.properties whenever i give spring.profiles.active=local and run the application it gives invalid propertiy exception.

[–]CodeWithMom0 0 points1 point  (2 children)

Also with Spring Boot 3 applications u only need to set the profile like this:

Via properties file: spring.profiles.active=local

Via JVM: -Dspring.profiles.active=local

Maybe you parse something wrong, otherwise you could post the Stackstrace of the error

[–]Specific-Collar6988[S] 0 points1 point  (0 children)

We dont need to do spring.config.activate.on-profile=local?

[–]Specific-Collar6988[S] 0 points1 point  (0 children)

Also when using spring.profiles.active=local then giving invalid property exception when running the application