How to Get Oracle Drivers using Maven

Liquibase and Maven require the use of drivers to read your database. This topic walks you through the process of getting Oracle drivers while using Maven.

Step 1: Add a dependency

Add a dependency to the <dependencies> section of the Maven pom.xml, in your Maven project directory as follows:

<!-- -->  

Step 2: Log in to Oracle

Navigate to Oracle and log in or create a new account.

Step 3: Include the repository

Update the settings.xml file located in your Maven project directory to include the repository:


Step 4: Include the plugin

Update your settings.xml file located in your Maven project directory to include the plugin Repository.


Step 5: Include the server

Update your settings.xml file in your Maven project directory to include the server for

    <id> </id>  
    <username>YOUR ORACLE USERNAME</username>  
    <password>YOUR ORACLE PASSWORD</password>  
            <host>ANY </host>  
            <port>ANY </port>  
            <realm>OAM 11g </realm>  
                        <name>http.protocol.allow-circular-redirects </name>  
                        <value>%b,true </value>  

Step 6: Create a settings-security.xml file

Create a settings-security.xml file in your .m2 directory with your Oracle password in an encrypted format.

Example: {USER_HOME}/.m2/ directory.

  1. Encrypt your master password: mvn -encrypt-master-password <your_password>
  2. Copy the encrypted password from the console.
  3. Paste the encrypted password into the settings-security.xml file located in your .m2 folder:
     <master>{YOUR ENCRYPTED MASTER PASSWORD}</master>   

Step 7: Configure Maven

Configure Maven with an HTTP Wagon compatible with

  • Download the HTTP Wagon JAR from Maven Central.
  • Copy the wagon-http JAR into: MAVEN_HOME/lib/ext/

To verify the configuration is correct, run mvn compile. If there are no errors stating that artifact cannot be found in, then everything is configured correctly. If you are getting this error, make sure you have not omitted a step in these instructions.