I have a package containing annotated entity classes that I import into my web project.
When tomcat deploys the project the entity class that are in the jar are not scanned for annotations. is there a way to tell spring to search for annotated classes inside a jar file? i.e. :
<context:component-scan base-package="{path to jar or something}"/>
If you mean
@Entityannotated classes,<context:component-scan>has nothing to do with them.@Entityclasses are discovered by Hibernate, so you need to configure Hibernate, not Spring.If you use Hibernate via JPA (i.e. you have
persistence.xml), you need to add the following line topersistence.xmlin order to scan/WEB-INF/lib/yourFileWithEntities.jarfor entity classes: