I have Projects built with Spring-boot, Maven and Kotlin. I want to expose some Services and FeignClients in a maven Project, so others can use them.
For a class with Annotations like @Service that works well. But I need to expose also FeignClients, which are annotated with @FeignClient, but as it looks other Projects are not able to inject those Clients. Do I have to configure something in my pom.xml? Im using spring-cloud-starter-openfeign
Here is some Code. My FeignClient looks like:
...
@FeignClient(name = "MyAPIClient", url = "\${url}", configuration = [MyApiClientConfiguration::class])
interface MyAPIClient {
...
And I try to inject that Client in another Project like this:
...
@Service
class MyService(val myAPIClient: MyAPIClient) {
...
The Error is pretty clear. It says, there is no bean with the name MyAPIClient. So it's not visible or available. "Consider defining a bean of type 'com.mycomp.MyAPIClient' in your configuration."
Do I have to configure something explicitly to expose an OpenFeignClient to other projects in my pom.xml?
Thanks for your help