Issue
I am using spring for some dependency injection via the annotations. The problem ist whenever I start the application and use the .jar ,created by gradle, in the classpath Im getting the following exception: "org.springframework.beans.factory.NoSuchBeanDefinitionException"
But if the /build/classes/main/ is in the classpath the beans are created and no exception is thrown.
So the beans are created in the build/classes/main/ but not in the build/libs/*.jar
Solution
Set @ComponentScan("classpath*:org.mypackage")
to let Spring scan jars as well.
Answered By - StanislavL