You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
As discussed with @snicoll, the javamail sample is broken because the environnement is not properly propagated to BootstrapCodeGeneratorRunner, for example based on the application.properties of the project. In javamail sample case, MailSenderPropertiesConfiguration is discarded at build time because no spring.mail.host is defined even if specified in the application.properties project file.
Like proposed in #989, we should probably use a file instead of command line arguments to pass those contextual information to BootstrapCodeGeneratorRunner.
The text was updated successfully, but these errors were encountered:
bclozel
changed the title
Populate correctly the environment in BootstrapCodeGeneratorRunner
Populate correctly the environment in BootstrapCodeGenerator
Aug 25, 2021
Prior to this commit, the `ContextBootstrapContributor` would prepare an
empty `Environment` and only apply some defaults to it. This lead to
several sample applications failing as properties provided by the
application (in `application.properties`) would not be considered.
As a consequence, all `@ConditionalOnProperty` on `*.enabled`
configuration keys would be discarded at build time if not enabled by
default in Spring Boot.
This commit loads a minimal infrastructure and prepares an `Environment`
that partially loads the application configuration at build time.
There are many limitations with this current approach:
* this doesn't support many customizations on the `SpringApplication`
* this doesn't load `Bootstrapper` so will fail with configuration
trying to resolve properties using `Bootstrappers`, like Eureka.
Fixesgh-992
Prior to this commit, the `ContextBootstrapContributor` would prepare an
empty `Environment` and only apply some defaults to it. This lead to
several sample applications failing as properties provided by the
application (in `application.properties`) would not be considered.
As a consequence, all `@ConditionalOnProperty` on `*.enabled`
configuration keys would be discarded at build time if not enabled by
default in Spring Boot.
This commit loads a minimal infrastructure and prepares an `Environment`
that partially loads the application configuration at build time.
There are many limitations with this current approach:
* this doesn't support many customizations on the `SpringApplication`
* this doesn't load `Bootstrapper` so will fail with configuration
trying to resolve properties using `Bootstrappers`, like Eureka.
Fixesgh-992
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As discussed with @snicoll, the
javamail
sample is broken because the environnement is not properly propagated toBootstrapCodeGeneratorRunner
, for example based on theapplication.properties
of the project. Injavamail
sample case,MailSenderPropertiesConfiguration
is discarded at build time because nospring.mail.host
is defined even if specified in theapplication.properties
project file.Like proposed in #989, we should probably use a file instead of command line arguments to pass those contextual information to
BootstrapCodeGeneratorRunner
.The text was updated successfully, but these errors were encountered: