I have a spring web application which takes in an external jar which contains some annotated controllers in packakge com.x.y.controller.
I have included com.x.y.controller package in my component scan path in spring-servlet.xml
<context:component-scan base-package="com.x.y.controller" />.
But When I deploy the application to my local tomcat server, those controller bean in my external jar does not get created.
However, when I extract the jar into my class path when I build the application(meaning having my package fully expanded into my web application class path) everything seems working fine. It seems weird to me because we also have some service classes with @component annotation in external jar. And these class seems working fine.
Does anyone know if it is expected behavior of spring? Or am I missing some configuration for spring to find those controllers?
Currently during development, if I change a class, changes are reflected to tomcat without rebuilding even if the class is in an external jar. If I need to extract the jar for those controllers to work, tomcat does not seem to take in changes in those controllers even if I restart the server. A rebuild is required to extract the jar again for any change to take effect. This would be very painful for development. I am relative new to spring. Does anybody see a solution for this if I have to go that way?