how to disable spring boot HibernateJpaAutoConfiguration
<p>i have an spring boot Project A that depend to project B. 
project B have some .hbm.xml resources.
in the project A  for change hibernate configuration i add DatabaseConfiguration  @Configuration for change sessionFactory</p>

<pre><code>@Bean
public LocalSessionFactoryBean sessionFactory() {
    LocalSessionFactoryBean sessionFactoryBean = new  LocalSessionFactoryBean();
    sessionFactoryBean.setDataSource(dataSource);
    sessionFactoryBean.setMappingLocations("classpath*:hibernate/**/*.hbm.xml");
    Properties hibernateProperties = new Properties();
    hibernateProperties.put("hibernate.dialect", HIBERNATE_DIALECT);
    hibernateProperties.put("hibernate.show_sql", HIBERNATE_SHOW_SQL);
    sessionFactoryBean.setHibernateProperties(hibernateProperties);

    return sessionFactoryBean;
}
</code></pre>

<p>build.gradle  have this dependency HibernateJpaAutoConfiguration run </p>

<pre><code>compile 'org.springframework.boot:spring-boot-starter-data-jpa'
</code></pre>

<p>when i run application in gradle bootRun or maven spring-boot:run 
application start and ok but when i run in java -jar 
i get exception </p>

<pre><code>  caused by: org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'entityManagerFactory' defined in class path 
 resource    [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: 
 Invocation of init method failed; nested exception is org.hibernate.MappingException: 
An association from the table core_organization_Structure refers to an unmapped class: org.roshan.framework.domain.security.User
</code></pre>

<p>i dont know why HibernateJpaAutoConfiguration start ???
after that i change Application.java to like this for exclude that but again not work .when i copy hbm to projectA .project A run and ok (with java -jar)</p>

<pre><code>@SpringBootApplication(exclude = {HibernateJpaAutoConfiguration.class })
</code></pre>

<p>update </p>

<p>after search and test ,i found problem and solve that .cause of problem was  using hibernate-entitymanager dependency in project.spring boot actuator detect this and auto config entity manager .after remove this dependency disable HibernateJpaAutoConfiguration work correct :D</p>