-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Only dev and prod profiles work #166
Comments
You are using gradle? Can you try -Pdev -Pswagger ? |
and the same result when visiting swagger-ui/index.html |
It is a bug. The dev config does not set micronaut environments at all while the prod config does still set the spring property. |
Just to make sure, the flags on maven/gradle are mostly used for changing the build/packaging. But to support switching the environment via gradle properties you could do in if (project.hasProperty("swagger")) {
profiles += ",swagger"
}
tasks.withType(JavaExec) {
classpath += configurations.developmentOnly
jvmArgs('-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
systemProperties(
'micronaut.environments':profiles
)
if (gradle.startParameter.continuous) {
systemProperties(
'micronaut.io.watch.restart':'true',
'micronaut.io.watch.enabled':'true',
"micronaut.io.watch.paths":"src/main"
)
}
} |
I think the issue larger than I thought. We build the jar e.g. via @JasonTypesCodes Correct my if thats wrong, but there is no property like |
More info here: https://docs.micronaut.io/latest/guide/index.html#environments |
We use either |
profile needs to be set using env variable, |
Yes. Same for gradle right now, but see above how to extend the gradle file. Nevertheless when building the jar with prod profile it should use prod configuration out of box. |
Overview of the issue
I'm trying to access swagger but noticed that only prod and dev profiles can be used. Starting app with -P dev,swagger starts only dev profile:
Swagger-ui resource contains invalid content:
The text was updated successfully, but these errors were encountered: