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.
if you are using spring boot use the entity scan annotation in your main springboot class
@EntityScan( basePackageClasses = {externalpackage.classname.class} )