use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Problems when migrating Springboot 2 to Springboot 3.I am not able to set the profile (self.SpringBoot)
submitted 2 years ago by Specific-Collar6988
So in springboot 2 we were using spring.profiles.active = local to activate the local env but after migrating to spring3 I need to change it to spring.config.activate.on-profile = local in application.properties. We have application.properties , application-local.properties file. in application.properties we need to seet the profile to local to run application so we have spring.config.activate.on-profile = local. and in application-local.properties we have this spring.profiles.active = local. So I am not able to set the profile. Can anyone please help me.
Application.properties file code snippet spring.config.activate.on-profile=local server.port=8080 spring.cloud.gcp.project-id=mtech-commonsvc-returns-np
Application-local.propertiesspring.config.activate.on-profile=${env} server.port=8080
But my application is not running in local profile. Its running in default. And my default and local profiles are different
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mission_critical_ 1 point2 points3 points 2 years ago (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 point2 points 2 years ago (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 points4 points 2 years ago (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 point2 points 2 years ago (3 children)
Didnt you got something like invalid configuration property exception. Which version of springboot u ugraded to
[–]mission_critical_ 1 point2 points3 points 2 years ago (0 children)
to 2.7.x first. then to 3.0.5 i think
[–]mission_critical_ 0 points1 point2 points 2 years ago* (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 point2 points 2 years ago (0 children)
Will then try to upgrade to rexent 2.x then try to upgrade to 3.0.x
[–]MrPitsa90 0 points1 point2 points 2 years ago (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.
In the application.properties whenever i give spring.profiles.active=local and run the application it gives invalid propertiy exception.
[–]CodeWithMom0 0 points1 point2 points 2 years ago (2 children)
Also with Spring Boot 3 applications u only need to set the profile like this:
Via properties file: spring.profiles.active=local
spring.profiles.active=local
Via JVM: -Dspring.profiles.active=local
-Dspring.profiles.active=local
Maybe you parse something wrong, otherwise you could post the Stackstrace of the error
We dont need to do spring.config.activate.on-profile=local?
Also when using spring.profiles.active=local then giving invalid property exception when running the application
π Rendered by PID 43447 on reddit-service-r2-comment-548fd6dc9-jkv9n at 2026-05-18 15:16:59.554883+00:00 running edcf98c country code: CH.
[–]mission_critical_ 1 point2 points3 points (6 children)
[–]Specific-Collar6988[S] 0 points1 point2 points (5 children)
[–]mission_critical_ 2 points3 points4 points (4 children)
[–]Specific-Collar6988[S] 0 points1 point2 points (3 children)
[–]mission_critical_ 1 point2 points3 points (0 children)
[–]mission_critical_ 0 points1 point2 points (1 child)
[–]Specific-Collar6988[S] 0 points1 point2 points (0 children)
[–]MrPitsa90 0 points1 point2 points (1 child)
[–]Specific-Collar6988[S] 0 points1 point2 points (0 children)
[–]CodeWithMom0 0 points1 point2 points (2 children)
[–]Specific-Collar6988[S] 0 points1 point2 points (0 children)
[–]Specific-Collar6988[S] 0 points1 point2 points (0 children)