I am trying to run a module but I am getting one of the autowired dependencies not getting resolved.
My project structure
pom.xml(parent)
|- worker
|- pom.xml (parent is the one at top level)
|- application1
|- pom.xml (parent is worker module)
When I run, mvn clean install on parent pom.xml and run java -jar application1.jar, it works fine.
When I run, mvn clean install on parent pom.xml and then once again mvn clean install on application1 module, running java -jar application1.jar throws autowired exceptions.
Error:
Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'WorkerServiceClient': Unsatisfied dependency expressed through field 'config': No qualifying bean of type 'io.micrometer.prometheus.PrometheusConfig' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
My main class is in worker module and I am adding it as a main class while packaging.
Any idea what I might be missing?