Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7616615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:55:58+00:00 2026-05-31T02:55:58+00:00

This post describes how to update two databases from maven using liquibase: liquibase using

  • 0

This post describes how to update two databases from maven using liquibase:
liquibase using maven with two databases
However, when I try the exact same configuration in my pom.xml (included below) it does not work. I get this error when running ‘mvn liquibase:update’:

The driver has not been specified either as a parameter or in a properties file.

Running with verbose set to true I get:

[INFO] Settings----------------------------
[INFO]     driver: null
[INFO]     url: null
[INFO]     username: null
[INFO]     password: null

so looks like the configuration is not being passed to liquibase. If the configuration part is outside executions it works, but that defeats the whole idea of having multiple executions – you would want to use different configurations for different executions.

  <plugin>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-plugin</artifactId>
    <version>1.9.5.0</version>

    <executions>
      <execution>
        <phase>process-resources</phase>
        <id>one</id>
        <goals>
          <goal>update</goal>
        </goals>
        <configuration>
          <changeLogFile>src/main/resources/liquibase/changelog-master.xml</changeLogFile>
          <driver>com.mysql.jdbc.Driver</driver>
          <url>jdbc:mysql://127.0.0.1:3306/${database.development}</url>
          <username>wifi_offload_app</username>
          <password />
          <dropFirst>${liquibase.dropFirst}</dropFirst>
        </configuration>
      </execution>
      <execution>
        <phase>process-resources</phase>
        <id>two</id>
        <goals>
          <goal>update</goal>
        </goals>
        <configuration>
          <changeLogFile>src/main/resources/liquibase/changelog-master-sbr.xml</changeLogFile>
          <driver>com.mysql.jdbc.Driver</driver>
          <url>jdbc:mysql://127.0.0.1:3307/${database.development.sbr}</url>
          <username>wifi_offload_app</username>
          <password />
          <dropFirst>${liquibase.dropFirst}</dropFirst>
        </configuration>
      </execution>
    </executions>

    <dependencies>
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.12</version>
      </dependency>
    </dependencies>
  </plugin>

Thanks,
Hari

Update after trying ‘mvn process-resources’ from Mark’s comment. Here’s the output from mvn updating both databases.

[hariharan@msg9]$ mvn process-resources
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Offload Manager Service
[INFO]    task-segment: [process-resources]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 12 resources
[INFO] [liquibase:update {execution: one}]
[INFO] ------------------------------------------------------------------------
[INFO] Executing on Database: jdbc:mysql://127.0.0.1:3306/db1
Mar 7, 2012 4:11:47 PM liquibase.database.template.JdbcTemplate comment
INFO: Create Database Lock Table
Mar 7, 2012 4:11:47 PM liquibase.database.template.JdbcTemplate comment
INFO: Lock Database
Mar 7, 2012 4:11:47 PM liquibase.lock.LockHandler acquireLock
INFO: Successfully acquired change log lock
Mar 7, 2012 4:11:47 PM liquibase.database.template.JdbcTemplate comment
INFO: Create Database Change Log Table
Mar 7, 2012 4:11:47 PM liquibase.database.AbstractDatabase checkDatabaseChangeLogTable
INFO: Creating database history table with name: `DATABASECHANGELOG`
Mar 7, 2012 4:11:48 PM liquibase.database.AbstractDatabase getRanChangeSetList
INFO: Reading from `DATABASECHANGELOG`
Mar 7, 2012 4:11:48 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset liquibase/changelogs/1328053095_tables.xml::1328053095-1::hariharan::(MD5Sum: bf33ef8ba7352e8c0864e9457ee642b)
Mar 7, 2012 4:11:49 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset liquibase/changelogs/1328053095_tables.xml::1328053095-2::hariharan::(MD5Sum: 7cc4f84be549dbcea3589d85df3e059)
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset liquibase/changelogs/1328053095_tables.xml::1328053095-3::hariharan::(MD5Sum: 59821447f5744410a1c36bccd16196f6)
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
Mar 7, 2012 4:11:50 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
Mar 7, 2012 4:11:50 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] [liquibase:update {execution: two}]
[INFO] ------------------------------------------------------------------------
[INFO] Executing on Database: jdbc:mysql://127.0.0.1:3307/db2
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Create Database Lock Table
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Lock Database
Mar 7, 2012 4:11:50 PM liquibase.lock.LockHandler acquireLock
INFO: Successfully acquired change log lock
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Create Database Change Log Table
Mar 7, 2012 4:11:50 PM liquibase.database.AbstractDatabase checkDatabaseChangeLogTable
INFO: Creating database history table with name: `DATABASECHANGELOG`
Mar 7, 2012 4:11:50 PM liquibase.database.AbstractDatabase getRanChangeSetList
INFO: Reading from `DATABASECHANGELOG`
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset liquibase/changelogs-sbr/1330991147_tables.xml::1330991147-1::hariharan::(MD5Sum: 8cf69599bcf338b57d7fe1ecc1471d86)
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset liquibase/changelogs-sbr/1330991147_tables.xml::1330991147-2::hariharan::(MD5Sum: cf9a9717987fda5deba07a7a943673e1)
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
Mar 7, 2012 4:11:50 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
Mar 7, 2012 4:11:50 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
Mar 7, 2012 4:11:50 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Wed Mar 07 16:11:50 PST 2012
[INFO] Final Memory: 23M/180M
[INFO] ------------------------------------------------------------------------
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:55:59+00:00Added an answer on May 31, 2026 at 2:55 am

    Does your build need to update 2 databases in one go? An alternative approach is to use Maven profiles as follows:

    mvn process-resources
    mvn -Pdb2 process-resources
    

    Project files

    |-- pom.xml
    `-- src
        `-- main
            `-- resources
                |-- com
                |   `-- myspotontheweb
                |       `-- db
                |           `-- changelog
                |               |-- db-changelog-1.0.xml
                |               `-- db-changelog-master.xml
                `-- liquibase.properties
    

    I prefer to use Maven’s generate-resources phase to create a liquibase properties file.

    pom.xml

    Contains two profiles at the end containing the properties associated with the two databases. This solution scales to any number of db environments.

    Another item of note is that liquibase uses the populated properties under the targets directory

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.db</groupId>
        <artifactId>liquibase-demo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.3.162</version>
            </dependency>
        </dependencies>
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.liquibase</groupId>
                    <artifactId>liquibase-maven-plugin</artifactId>
                    <version>2.0.1</version>
                    <executions>
                        <execution>
                            <phase>process-resources</phase>
                            <configuration>
                                <propertyFile>target/classes/liquibase.properties</propertyFile>
                                <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                            </configuration>
                            <goals>
                                <goal>update</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        <profiles>
            <profile>
                <id>db1</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <properties>
                    <liquibase.url>jdbc:h2:target/db1/liquibaseTest;AUTO_SERVER=TRUE</liquibase.url>
                    <liquibase.driver>org.h2.Driver</liquibase.driver>
                    <liquibase.username>user</liquibase.username>
                    <liquibase.password>pass</liquibase.password>
                </properties>
            </profile>
            <profile>
                <id>db2</id>
                <properties>
                    <liquibase.url>jdbc:h2:target/db2/liquibaseTest;AUTO_SERVER=TRUE</liquibase.url>
                    <liquibase.driver>org.h2.Driver</liquibase.driver>
                    <liquibase.username>user</liquibase.username>
                    <liquibase.password>pass</liquibase.password>
                </properties>
            </profile>
        </profiles>
    </project>
    

    liquibase.properties

    This is the template file populated with the profile property values for the specific environment.

    # Database credentials
    url=${liquibase.url}
    driver=${liquibase.driver}
    username=${liquibase.username}
    password=${liquibase.password}
    
    # Liquibase changelog
    changeLogFile=com/myspotontheweb/db/changelog/db-changelog-master.xml
    

    Update

    And alternative strategy would be to run the plug-in directly, instead of integrating it into a Maven life-cycle.

    mkdir target
    mvn liquibase:update
    mvn -Pdb2 liquibase:update
    

    Again you are using a profile to control the property settings.

    pom.xml

    The difference is that the plug-ins settings are controlled by properties set in the profile. No more properties file created under the targets directory for shipment in your jar.

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.db</groupId>
        <artifactId>liquibase-demo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.3.162</version>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.liquibase</groupId>
                    <artifactId>liquibase-maven-plugin</artifactId>
                    <version>2.0.1</version>
                    <configuration>
                        <url>${liquibase.url}</url>
                        <driver>${liquibase.driver}</driver>
                        <username>${liquibase.username}</username>
                        <password>${liquibase.password}</password>
                        <changeLogFile>src/main/resources/com/myspotontheweb/db/changelog/db-changelog-master.xml</changeLogFile>
                        <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        <profiles>
            <profile>
                <id>db1</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <properties>
                    <liquibase.url>jdbc:h2:target/db1/liquibaseTest;AUTO_SERVER=TRUE</liquibase.url>
                    <liquibase.driver>org.h2.Driver</liquibase.driver>
                    <liquibase.username>user</liquibase.username>
                    <liquibase.password>pass</liquibase.password>
                </properties>
            </profile>
            <profile>
                <id>db2</id>
                <properties>
                    <liquibase.url>jdbc:h2:target/db2/liquibaseTest;AUTO_SERVER=TRUE</liquibase.url>
                    <liquibase.driver>org.h2.Driver</liquibase.driver>
                    <liquibase.username>user</liquibase.username>
                    <liquibase.password>pass</liquibase.password>
                </properties>
            </profile>
        </profiles>
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: Perhaps this wasn't clear from my original post, but I'm mainly interested in
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
UPDATE As Mathias notes below, this exact problem has been reported and resolved here:
With preferably using jquery id want to update written text from input field into
Update: Since this is unanswered, I'm changing the question slightly. Comments on the post
I found this solution on here How to update strongly typed Html.DropDownList using Jquery
This post reference to the One Definition Rule. Wikipedia is pretty bad on explaining
This post on SO answers most of the questions I have (much thanks to
This post asks this question but doesn't really give an answer, so I thought
This post relates to this: Add row to inlines dynamically in django admin Is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.