天道酬勤,学无止境

spring-boot-starter

Spring boot custom starter , application doesn't find required bean

http://www.baeldung.com/spring-boot-custom-starter I have followed tutorial and github example provided from the link above and have implemented similar way. I am using spring-boot-starter-parent :2.0.0.M3. Even after including my custom starter dependency in the pom for the app, it doesn't find required bean without @componentScan while deploying it. It is giving following error. APPLICATION FAILED TO START Description: Field fooApiCaller in com.core.controller.TestController required a bean of type 'service.ApiCaller' that could not be found. Action: Consider defining a bean of type 'service

2021-09-06 17:05:50    分类:问答    java   spring-boot   spring-boot-starter

Togglz Yml/Yaml Configuration for My SpringBoot Not working

Trying to create Feature Toggles using Togglz. Made below configurations/code in my Application, bootstrap.yml: togglz: enabled: true features: FEATURE_ONE: true Feature Enum Class: public enum AppFeatures implements Feature { @Label("FEATURE_ONE") FEATURE_ONE; public boolean isActive() { return FeatureContext.getFeatureManager().isActive(this); } } My Requirement: I need to do like this, if FEATURE_ONE is configured true in yml file, then if condition, else, else has to execute.. if(AppFeatures.FEATURE_ONE.isActive()){}else{} but my expectation not happening. Though I have given true in yml

2021-06-28 00:44:35    分类:问答    yaml   togglz   spring-boot-starter

Spring boot auto configuration with dependency and without @ComponentScan

Spring boot provides @ComponentScan to find packages to be scanned. I am building a library which has @RestControllers inside with package com.mylib.controller. There are other classes as well with stereotype annotations in different packages. So, if some one is developing SpringBoot Application with com.myapp base package. He uses my library in his application. He need to mention @ComponentScan("com.mylib") to discover stereotype components of library. Is there any way to scan components without including library package in @ComponentScan? As spring-boot-starter-actuator expose its endpoints

2021-05-31 17:40:55    分类:问答    spring-boot   dependency-injection   spring-boot-actuator   component-scan   spring-boot-starter