2016-07-02 11 views
2

jHipsterアプリケーションでLiquibaseを使用しようとしていますが、いくつか問題があります。Liquibase:パーシスタンスユニットのルートURLを解決できません

ポンポンから関連するセクションは次のとおりです。私は取得しています

<plugin> 
       <groupId>org.liquibase</groupId> 
       <artifactId>liquibase-maven-plugin</artifactId> 
       <version>${liquibase.version}</version> 
       <dependencies> 
        <dependency> 
         <groupId>org.javassist</groupId> 
         <artifactId>javassist</artifactId> 
         <version>3.18.2-GA</version> 
        </dependency> 
        <dependency> 
         <groupId>org.liquibase.ext</groupId> 
         <artifactId>liquibase-hibernate4</artifactId> 
         <version>${liquibase-hibernate4.version}</version> 
        </dependency> 
        <dependency> 
         <groupId>org.springframework.boot</groupId> 
         <artifactId>spring-boot-starter-data-jpa</artifactId> 
         <version>${project.parent.version}</version> 
        </dependency> 
        <dependency> 
         <groupId>org.hibernate</groupId> 
         <artifactId>hibernate-core</artifactId> 
         <version>4.3.11.Final</version> 
        </dependency> 
        <dependency> 
         <groupId>javax</groupId> 
         <artifactId>javaee-web-api</artifactId> 
         <version>6.0</version> 
        </dependency> 


       </dependencies> 
       <configuration> 
        <changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile> 
        <diffChangeLogFile> 
         src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml 
        </diffChangeLogFile> 
        <driver>org.postgresql.Driver</driver> 
        <url>jdbc:postgresql://localhost:5432/myapp</url> 
        <defaultSchemaName/> 
        <username>postgres</username> 
        <password/> 
        <referenceUrl>hibernate:spring:com.myapp.domain?dialect=org.hibernate.dialect.PostgreSQL94Dialect&amp;hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy</referenceUrl> 
        <verbose>true</verbose> 
        <logging>debug</logging> 
       </configuration> 
      </plugin> 

エラーは次のとおりです。

INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.844 s 
[INFO] Finished at: 2016-07-03T00:20:52+02:00 
[INFO] Final Memory: 25M/386M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.4.2:diff (default-cli) on project staffservice: Error setting up or running Liquibase: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL: class path resource [] cannot be resolved to URL because it does not exist -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.4.2:diff (default-cli) on project staffservice: Error setting up or running Liquibase: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) 
    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:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL 
    at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:398) 
    at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute(LiquibaseDatabaseDiff.java:146) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) 
    ... 20 more 
Caused by: liquibase.exception.DatabaseException: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL 
    at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:157) 
    at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask(LiquibaseDatabaseDiff.java:166) 
    at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:394) 
    ... 23 more 
Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL 
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:591) 
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:443) 
    at liquibase.ext.hibernate.database.HibernateSpringDatabase.buildConfigurationFromScanning(HibernateSpringDatabase.java:227) 
    at liquibase.ext.hibernate.database.HibernateSpringDatabase.buildConfiguration(HibernateSpringDatabase.java:55) 
    at liquibase.ext.hibernate.database.HibernateDatabase.setConnection(HibernateDatabase.java:45) 
    at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:131) 
    at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:151) 
    at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:85) 
    ... 25 more 
Caused by: java.io.FileNotFoundException: class path resource [] cannot be resolved to URL because it does not exist 
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187) 
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:588) 
    ... 32 more 
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

は、私は、データベース名が正しいことを確認することができます。また、URLポートも正しいはずです。だから例外はあまり意味がありません。

答えて

0

私は同じ問題を抱えていましたが、プロジェクトにはポムが属していたエンティティがないことが分かりました。

関連する問題