i have a project setup where i have modularized a project, and packaged a module into a jar file which gets included in the main project when we create a war and deploy it.
Simply use
@EntityScan("com...pakage-which-contains-entities...")
Or if you have multiple entities packages, use
@EntityScan(basePackages = {"...pkg1...", "...pkg2..."} )