title: liquibase-maven-plugin liquibase:diff - Not working (Could not find any META-INF/persistence.xml file in the classpath)
body: <p>I am getting hard time to run liquibase:diff through liquibase-maven-plugin</p>
  
  <p>I have a Spring Data JPA based application bootstrapped using spring-boot. So, there won't be any persistence.xml</p>
  
  <p>Here is the snippet from pom.xml:</p>
  
  <pre><code>&lt;plugin&gt;
  &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  &lt;artifactId&gt;liquibase-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;3.2.2&lt;/version&gt;
  &lt;configuration&gt;
      &lt;propertyFile&gt;target/classes/liquibase.properties&lt;/propertyFile&gt;
  &lt;/configuration&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.liquibase.ext&lt;/groupId&gt;
      &lt;artifactId&gt;liquibase-hibernate4&lt;/artifactId&gt;
      &lt;version&gt;${liquibase_hibernate_version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
      &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
      &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
      &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;mysql&lt;/groupId&gt;
      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;version&gt;${mysql.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
      &lt;version&gt;${spring.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      &lt;version&gt;${hibernate.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
      &lt;version&gt;${hibernate-entitymanager.version}&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the liquibase.properties:</p>
  
  <pre><code>changeLogFile: classpath:/db/changelog/changelog-master.xml
  diffChangeLogFile: src/main/resources/db/changelog/changelog-sql-2_0.sql
  driver: com.mysql.jdbc.Driver
  url: jdbc:mysql://localhost:3306/sample
  defaultSchema: sample
  username: root
  password: root
  referenceUrl: hibernate:spring:se.sample.core.domain?dialect=org.hibernate.dialect.MySQL5Dialect
  verbose: true
  dropFirst: false
  logging: debug
  </code></pre>
  
  <p>Here is the maven command that I am using:</p>
  
  <pre><code>mvn resources:resources liquibase:diff -Pprod
  </code></pre>
  
  <p>And here is the error that I am getting:</p>
  
  <pre><code>[INFO] Executing on Database: jdbc:mysql://localhost:3306/sample
  INFO 7/30/14 2:47 PM: liquibase-hibernate: Reading hibernate configuration hibernate:spring:se.sample.core.domain?dialect=org.hibernate.dialect.MySQL5Dialect
  INFO 7/30/14 2:47 PM: liquibase-hibernate: Found package se.sample.core.domain
  INFO 7/30/14 2:47 PM: liquibase-hibernate: Found dialect org.hibernate.dialect.MySQL5Dialect
  Jul 30, 2014 2:47:21 PM org.hibernate.jpa.boot.internal.PersistenceXmlParser doResolve
  **INFO: HHH000318: Could not find any META-INF/persistence.xml file in the classpath**
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 7.095s
  [INFO] Finished at: Wed Jul 30 19:38:38 CEST 2014
  [INFO] Final Memory: 18M/310M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.2.2:diff (default-cli) on project fmu-core: Error setting up or running Liquibase: java.lang.NullPointerException -&gt; [Help 1]
  [ERROR] 
  </code></pre>
  
  <p>Since I am using Spring JPA without any persistence.xml so, I can't understand how to make it work.</p>
  
  <p>Can anyone guide please?</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>Added -X to maven command to get complete details:</p>
  
  <pre><code>INFO: HHH000318: Could not find any META-INF/persistence.xml file in the classpath
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.192s
  [INFO] Finished at: Wed Jul 30 20:20:24 CEST 2014
  [INFO] Final Memory: 21M/433M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.2.2:diff (default-cli) on project fmu-core: Error setting up or running Liquibase: java.lang.NullPointerException -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.2.2:diff (default-cli) on project fmu-core: Error setting up or running Liquibase: java.lang.NullPointerException
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: java.lang.NullPointerException
      at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:371)
      at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute(LiquibaseDatabaseDiff.java:129)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: liquibase.exception.DatabaseException: java.lang.NullPointerException
      at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:53)
      at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask(LiquibaseDatabaseDiff.java:144)
      at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:367)
      ... 22 more
  Caused by: java.lang.NullPointerException
      at liquibase.ext.hibernate.database.HibernateSpringDatabase.buildConfigurationFromScanning(HibernateSpringDatabase.java:237)
      at liquibase.ext.hibernate.database.HibernateSpringDatabase.buildConfiguration(HibernateSpringDatabase.java:56)
      at liquibase.ext.hibernate.database.HibernateDatabase.setConnection(HibernateDatabase.java:42)
      at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:123)
      at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
      at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:44)
      ... 24 more
  </code></pre>