I am running a spring boot application with the following structure
Main Application com/my/application/app/boot/AppStarter.java depends on Lib Application Lib Application META-INF/package/persistence.xml com/my/application/data/Entity1.java Where Entity 1 is a persistence object using @Entity and @Table annotations
AppStarter is as follows:
@ComponentScan({ "com.my.application.sampleScan1", "com.my.application.sampleScan2"}) @EntityScan(basePackages={"com.my.application.data"}) @EnableAutoConfiguration @Configuration @PropertySources({ @PropertySource(value = "classpath:application.properties", ignoreResourceNotFound = true), @PropertySource(value = "classpath:test.properties", ignoreResourceNotFound = true) }) @ImportResource({ "classpath:my/application/fake/fakeContext.xml"}) public class FakeAppBooter { public static void main(String args[]) { SpringApplication.run(FakeAppBooter.class, args); } } When I package this using the spring boot application as a jar, The Lib Application is within the /lib/LibApplication.jar , however when it tries to access the Entity Entity1, I get an: org.hibernate.MappingException: Unknown entity: com.my.application.data.Entity1
When this is executed from within eclipse, this works fine, it only breaks when i run the spring-boot-plugin generated jar.