Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot application does not load spring.factories

I initialized a new project with Eclipse Spring boot and created the spring.factories file under src/main/resources/META-INF. On startup the configured bean does not get loaded.

Spring.factories:

org.springframework.cloud.bootstrap.BootstrapConfiguration=\
net.conjur.config.ConjurConfiguration,\
net.conjur.config.ConjurPropertySourceLocator

My application class got some annotations:

@SpringBootApplication
@SpringBootConfiguration
@EnableAutoConfiguration

As an example one of the beans looks like this:

@Configuration
public class ConjurConfiguration {
@Bean
public ConjurPropertySource getConjurPropertySource() {
return new ConjurPropertySource();
}
}

I already tried this:

  1. moving the META-INF folder in the project into different places, but without any luck.
  2. I tried to load the file from the main Application using the resource loader, but also no success
like image 837
VoehrsCyber Avatar asked Oct 22 '25 13:10

VoehrsCyber


1 Answers

Processing of Bootstrap configuration is disabled by default in Spring Cloud 2020.0 and later. To re-enable it, set spring.cloud.bootstrap.enabled=true.

like image 144
Andy Wilkinson Avatar answered Oct 25 '25 03:10

Andy Wilkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!