0

So I have I built a custom Springboot starter and autoconfiguration and everything builds fine, the code is all their in the local maven repo.

I even checked the generated jars and everything looksgood.

Can't load the generated files into the project but when I look at the generated beens, there is no sign of beans created by autoconfiguration (or the autoconfiguration itself) : https://github.com/orubel/spring-boot-starter-beapi/issues/37

Project code can be sen here: https://github.com/orubel/spring-boot-starter-beapi/blob/main/beapi-lib/build.gradle

what am I doing wrong that implementations can';t see the beans?

I have tried bringing in the dependencies from mavenLocal() with:

implementation "io.beapi:beapi-lib:0.4" implementation "io.beapi:beapi-spring-boot-starter:0.4"

and with:

implementation "io.beapi:beapi-lib:0.4" implementation "io.beapi:beapi-spring-boot-autoconfigure:0.4"

Both have the same error of stating that an AUTOWIRED bean (from the autoconfiguration) cannot be found:

Consider defining a bean of type 'io.beapi.lib.service.PrincipleService' in your configuration.

If I comment out the autowired bean, it just throws error that bean is null.

1 Answer 1

-1

Ok solved my issue.

As I am instantiating the beans from a library I am creating through the starter, I have to do a '@ComponentScan' on those classes.

So just adding:

@ComponentScan(["io.beapi.lib.service"])

To the application main class was enough to resolve this :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.