-
Notifications
You must be signed in to change notification settings - Fork 41.1k
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
Investigate developer specific profile / properties support #42066
Comments
I tackled it by: if (ClassUtils.isPresent("org.springframework.boot.devtools.RemoteSpringApplication",
DemoApplication.class.getClassLoader())) {
String profiles = System.getProperty(ACTIVE_PROFILES_PROPERTY_NAME);
if (profiles == null) {
profiles = System.getenv(ACTIVE_PROFILES_PROPERTY_NAME.replaceAll("\\.", "_").toUpperCase());
if (profiles == null) {
System.setProperty(ACTIVE_PROFILES_PROPERTY_NAME, "dev");
}
}
} I wish Spring Boot would provide an official solution. |
Just as a data point for discussions, we have core plugins/libraries that do the following:
The Projects will usually have an The We have other patterns for pulling secure, environment-specific dev-test credentials from user home -- primarily for dev testing and triage -- but don't automatically pull any external properties files into all applications to avoid collisions/confusion because, for one example, which It's all a non-obvious mess we are constantly tinkering with, so I agree generally it would be nice to have something built-in that, at a minimum, discouraged configuring secrets/integration points in |
In my library (see docs), I provide two profiles out-of-the-box that are enabled when running the application in development mode ( To achieve this, I relied on an The library is included in a project only for development and test, so there is no risk to include dev/test config in the final production artefact. For example, in Gradle: dependencies {
testAndDevelopmentOnly 'io.arconia:arconia-dev-tools'
} Furthermore, the whole feature can be turned off via properties. |
There have been a few issues relating to developer specific properties or profiles. The requests tend to be a variation of "when I run my app locally I want a developer profile active, when in production I do not". See #25712 #32479 #39156.
The text was updated successfully, but these errors were encountered: