2011-02-01 72 views
3

我有以下的结构从运行Maven的一个数据库:liquibase使用maven有两个数据库

<plugin> 
      <groupId>org.liquibase</groupId> 
      <artifactId>liquibase-plugin</artifactId> 
      <version>1.9.5.0</version> 
      <executions> 
       <execution> 
        <phase>process-resources</phase> 
        <configuration> 
         <changeLogFile>src/main/resources/db.changelog.xml</changeLogFile> 
         <driver>com.mysql.jdbc.Driver</driver> 
         <url>jdbc:mysql://localhost:3306/charm</url> 
         <username>***</username> 
         <password>***</password> 
        </configuration> 
        <goals> 
         <goal>update</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

现在我想在名为charm2在同一台服务器上运行的另一个数据库。我试过这个:

<plugin> 
      <groupId>org.liquibase</groupId> 
      <artifactId>liquibase-plugin</artifactId> 
      <version>1.9.5.0</version> 
      <executions> 
       <execution> 
        <phase>process-resources</phase> 
        <configuration> 
         <changeLogFile>src/main/resources/db.changelog.xml</changeLogFile> 
         <driver>com.mysql.jdbc.Driver</driver> 
         <url>jdbc:mysql://localhost:3306/charm</url> 
         <username>***</username> 
         <password>***</password> 
        </configuration> 
        <goals> 
         <goal>update</goal> 
        </goals> 
       </execution> 
       <execution> 
        <phase>process-resources</phase> 
        <configuration> 
         <changeLogFile>src/main/resources/db.changelog.xml</changeLogFile> 
         <driver>com.mysql.jdbc.Driver</driver> 
         <url>jdbc:mysql://localhost:3306/charm2</url> 
         <username>***</username> 
         <password>***</password> 
        </configuration> 
        <goals> 
         <goal>update</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

它不起作用。有谁知道如何解决这个问题?

+0

应该工作,有什么错误? – Nishant 2011-02-01 17:31:07

+0

org.apache.maven.reactor.MavenExecutionException:无法验证项目 – Ikthiander 2011-02-01 19:38:14

回答

6

也许你可以试一试<id>给。像

... 
<execution> 
    <id>charm</id> 
    <phase>process-resources</phase> 
    <configuration> 
    ... 
</execution> 
<execution> 
    <id>charm2</id> 
    <phase>process-resources</phase> 
    <configuration> 
    ... 
</execution> 
... 

的东西,如果这不起作用,你可以使用完整的堆栈跟踪指定Maven在无法验证的聚甲醛的确切行来更新你的问题。

相关问题