Questions tagged [spring-autoconfiguration]

99 questions
0
votes
1 answer

Using @ConditionalOnProperty with regex prefix patterns spring boot

I have a configuration class in my spring boot application which I want to enable only if certain properties in my application.properties file matches it. @Configuration @ConditionalOnProperty(prefix = "^sites\\[.*\\].*", name = "^prefix.*") public…
Abhilash
  • 803
  • 1
  • 9
  • 32
0
votes
0 answers

No Beans Found: spring-boot-actuator 2.3.5 in spring mvc without springboot

I'm trying to upgrade the version from springVersion = '4.3.27.RELEASE' springBootVersion = '1.5.22.RELEASE'to springVersion = '5.3.25' springBootVersion ='2.3.5.RELEASE' The issue i face is in ActuatorConfiguation.java where No beans of…
0
votes
1 answer

Spring ConditionalOnBean does not detect bean of type RestController

I have Spring boot app and I create my own autoconfiguration that should create bean in case any RestController in present in the context. It looks something like that: @AutoConfiguration @ConditionalOnBean(RestController.class) public class…
user1409534
  • 2,140
  • 4
  • 27
  • 33
0
votes
0 answers

Why Isn't Spring Autoconfiguration Working for a Third-Party Library (kie.org kiserver)?

I've created a Spring Boot Starter project using start.spring.io picking the latest (3.0.1 as of this writing) and added org.kie:kie-server-spring-boot-starter-optaplanner:7.73.0.Final as a dependency. This brings along with it several…
Richard Plana
  • 121
  • 2
  • 2
  • 4
0
votes
0 answers

Component inside auto configuration application not getting registered

I have created a simple spring boot starter configuration. Along with other files I have Interceptor which should auto-register. My Configuration is registered in the file is as…
0
votes
0 answers

How to create a spring boot starter to initialize applications.properties

How can I create a Spring Boot starter to initialize properties automatically instead of adding them on the application.properties of the application? For example, the configuration below would be done in the starter, not in the…
0
votes
0 answers

is there a way to set default value of spring configuration property when some dependency/jar resp. it's classes are available in classpath?

example: I have groupId=myGroup, artifactId=feignOkHttp dependency jar file. In case I want to do some standard auto-configuration there, I would create auto-configuration classes and refer it in META-INF/spring.factories However, here I need to set…
mirec
  • 627
  • 1
  • 8
  • 23
0
votes
1 answer

@EnableReactiveElasticsearchRepositories based on profile?

I would like to have @EnableReactiveElasticsearchRepositories enabled only when the specific profile is present. In Kotlin Bean DSL I can define the following condition: environment( { activeProfiles.contains("local") }, { …
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
0 answers

Exclude Single Bean using @SpringBootApplication

I want to exclude a single Spring bean that's included in the packages scanned by Spring's component scan. I'd like to do this by using some kind of exclude parameter of the @SpringBootApplication annotation. All of Spring Boot's documentation…
0
votes
0 answers

The Actual Different: Spring boot @ComponentScan vs @Import when involving ConditionalOnClass

Context I know there are a lot of posts regarding the comparison between these two. All of them just focus on @Import works on single Config file while @ComponenentScan will scan all config, bean, service files. I find something new, hope someone…
0
votes
1 answer

How to remove AbstractHttpConfigurer from default HttpSecurity

I'm creating an internal lib, and I want to perform some autoconfiguration that involve removing security customizers that are added by default, for example LogoutConfigurer, as if it was not part of the default HttpSecurity prototype bean: …
mdrg
  • 3,242
  • 2
  • 22
  • 44
0
votes
1 answer

Not able to use a config created in a java library

I am creating java jar library (maven) which will contain common configuration & util classes used in many services. My project is not multi-modules, so creating a new maven project. The configuration class I am not able to use in my project. Found…
Satish Patro
  • 3,645
  • 2
  • 27
  • 53
0
votes
2 answers

Lazy load spring auto configuration

I have dependency in my spring boot project which fetches values of some properties using Spring's EnvironmentPostProcessor. Now these properties are database credentials and not everyone has access to the credential since there is no dev…
0
votes
0 answers

spring-kafka starting another container with @RefreshScope annotation

I am integrating my spring-kafka consumer with spring-cloud. Here is the bean that basically has the @KafkaListener @ConditionalOnMissingBean @Bean @RefreshScope SinkGenericKafkaConsumer
0
votes
0 answers

Error upgrading to Spring boot version 2.6.7, Unable to read meta-data for class org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration

I have updated spring boot version to 2.6.7 from version 2.0.5.RELEASE, After this change when I run my application i am getting Unable to read meta-data for class org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration. Package cloud…