-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Document that -Dspring.profiles.active should not be used to run an app with Maven #10926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As explained in the documentation, adding DevTools causes run to fork a separate JVM. You are passing the system property into Maven’s JVM so it isn’t picked up by the forked JVM used by the application. You should use |
Thanks for your fast response and explanation. Imho this could be made a little bit clearer in the documentation as not everyone is aware that spawning own processes implies that this JVM-Argument is swallowed but thats up to you. Just as an explaination why I opened this: Some members of a team I know used Have a nice weekend & regards |
Ok, let’s see what we can do. Perhaps you or someone on your team could propose something that would have made the documentation clearer? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There is also the idea of logging something to indicate that the JVM has been forked and variables set on the maven process won't be transmitted. I've shared some reservation on #16819 and flagging for team attention to see what the rest of the team thinks. |
Logging is better than nothing, but I would prefer something on screen (if there is enough space for ascii art banners, then a one-liner should fit there as well ;-)). |
We've decided to revisit the documentation and change the default value of the |
Running my application via
./mvnw spring-boot:run -Dspring.profiles.active=dev
works and activates thedev
-Profile. However if I addspring-boot-devtools
the specified profile is not used any longer.An example showing this behaviour can be found at https://github.com/mvitz/maven-spring-boot-devtools-Dspring.profiles.active-bug
Best outcome would be that this will be fixed, if not possible it should at least be documented.
The text was updated successfully, but these errors were encountered: