2011-02-01 54 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在無法驗證的聚甲醛的確切行來更新你的問題。

相關問題