Maven Auto Database to Liquibase Generator Plugin

Maven plugin to generate xml liquibase files from database

License

License

Categories

Categories

Auto Application Layer Libs Code Generators
GroupId

GroupId

com.github.yadickson
ArtifactId

ArtifactId

autodblq
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven Auto Database to Liquibase Generator Plugin
Maven plugin to generate xml liquibase files from database
Project URL

Project URL

https://github.com/yadickson/autodblq
Project Organization

Project Organization

Yadickson Soto
Source Code Management

Source Code Management

https://github.com/yadickson/autodblq

Download autodblq

How to add to project

<plugin>
    <groupId>com.github.yadickson</groupId>
    <artifactId>autodblq</artifactId>
    <version>1.3.0</version>
</plugin>

Dependencies

compile (11)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.2
org.apache.maven.plugin-tools : maven-plugin-tools-api jar 3.5
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5
org.freemarker : freemarker jar 2.3.23
commons-lang : commons-lang jar 2.6
commons-io : commons-io jar 2.5
com.ibm.db2 : jcc jar 11.5.0.0
com.jslsolucoes : ojdbc6 jar 11.2.0.1.0
org.postgresql : postgresql jar 42.1.4
net.sourceforge.jtds : jtds jar 1.3.1
commons-dbutils : commons-dbutils jar 1.7

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.jmockit : jmockit jar 1.37
org.mockito : mockito-core jar 1.10.19

Project Modules

There are no modules declared in this project.

Maven Auto Database to Liquibase Generator Plugin

TravisCI Status Codecov Status Central OSSRH Central Maven

Maven plugin to generate xml liquibase files from database

Support

  • DB2
  • Oracle DataBase 11g and 12c (not yet)
  • Basic PostgresSQL (not yet)
  • Basic SQL Server (Tested 2017, Driver jTDS) (not yet)
  • Command line for driver, user, pass and connectionString parameters

DB2

  • TABLES
  • AUTO INCREMENT (always increment and start by 1)
  • DEFAULT VALUES (only string and numeric)
  • INDEX CONSTRAINS
  • UNIQUE CONSTRAINS
  • PRIMARY KEY CONSTRAINS
  • FOREIGN KEY CONSTRAINS (missing onDelete and onUpdate actions yet)
  • VIEWS
  • FUNCTIONS
  • PROCEDURES
  • SEQUENCES (not yet)
  • RESET SEQUENCES (not yet)
  • INSERT DATA TABLES (not yet)
  • TRIGGERS (not yet)
  • Data tables

Dependencies

DB2

<dependency>
    <groupId>com.ibm.db2</groupId>
    <artifactId>jcc</artifactId>
    <version>11.5.0.0</version>
</dependency>

Oracle

<dependency>
    <groupId>com.jslsolucoes</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.1.0</version>
</dependency>

PostgreSQL

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.1.4</version>
</dependency>

SQL Server

<dependency>
    <groupId>net.sourceforge.jtds</groupId>
    <artifactId>jtds</artifactId>
    <version>1.3.1</version>
</dependency>

POM plugin config

<plugin>
    <groupId>com.github.yadickson</groupId>
    <artifactId>autodblq</artifactId>
    <version>...</version>
    <executions>
        <execution>
            <goals>
                <goal>generator</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <driver>...</driver>
        <url>...</url>
        <username>...</username>
        <password>...</password>
        <author>...</author>
        <version>...</version>
        <lqversion>...</lqversion>
        <lqpro>...</lqpro>
        <csvQuotchar>...</csvQuotchar>
        <csvSeparator>...</csvSeparator>
        <tables>
            <param>...</param>
            <param>...</param>
        </tables>
        <views>
            <param>...</param>
            <param>...</param>
        </views>
        <functions>
            <param>...</param>
            <param>...</param>
        </functions>
        <loadData>
            <param>...</param>
            <param>...</param>
        </loadData>
        <sortViews>
            <param>...</param>
            <param>...</param>
        </sortViews>
        <sortFunctions>
            <param>...</param>
            <param>...</param>
        </sortFunctions>
        <excludeTables>
            <param>...</param>
            <param>...</param>
        </excludeTables>
        <excludeViews>
            <param>...</param>
            <param>...</param>
        </excludeViews>
        <excludeFunctions>
            <param>...</param>
            <param>...</param>
        </excludeFunctions>
        <schemas>
            <param>...</param>
            <param>...</param>
        </schemas>
    </configuration>
</plugin>

driver (required)

JDBC Driver class name, examples:

com.ibm.db2.jcc.DB2Driver
oracle.jdbc.driver.OracleDriver
org.postgresql.Driver
net.sourceforge.jtds.jdbc.Driver

url (required)

Database connection string, examples:

jdbc:db2://${host}:${port}/${db}
jdbc:oracle:thin:@${host}:${port}:${db}
jdbc:postgresql://${host}:${port}/${db}
jdbc:jtds:sqlserver://${host}:${port}/${db}

username (required)

Database username

password (required)

Database password

lqversion (optional)

Liquibase version, default 3.6

lqpro (optional)

Liquibase pro license, default false

tables (optional)

Tables to include, example XY.*

views (optional)

Views to include, example VXY.*

functions (optional)

Functions to include, example FXY.*

schemas (optional)

Schemas to include, example MN.*

loadData (optional)

Load data table content, example TXY.*

csvQuotchar (optional, default ')

Csv Quotchar to load data table content

csvSeparator (optional, default ,)

Csv Separator to load data table content

Command line support

<plugin>
    <groupId>com.github.yadickson</groupId>
    <artifactId>autodblq</artifactId>
    <version>...</version>
    <configuration>
        <tables>
            <param>...</param>
            <param>...</param>
        </tables>
    </configuration>
</plugin>
$ mvn autodblq:generator -Dautodblq.driver=... -Dautodblq.url=... -Dautodblq.username=... -Dautodblq.password=...

POM Basic Configuration (include tables)

<plugin>
    <groupId>com.github.yadickson</groupId>
    <artifactId>autodblq</artifactId>
    <version>...</version>
    <executions>
        <execution>
            <goals>
                <goal>generator</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <driver>...</driver>
        <url>...</url>
        <username>...</username>
        <password>...</password>
        <tables>
            <param>...</param>
            <param>...</param>
        </tables>
    </configuration>
</plugin>

POM Basic Configuration (include schemas)

<plugin>
    <groupId>com.github.yadickson</groupId>
    <artifactId>autodblq</artifactId>
    <version>...</version>
    <executions>
        <execution>
            <goals>
                <goal>generator</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <driver>...</driver>
        <url>...</url>
        <username>...</username>
        <password>...</password>
        <schemas>
            <param>...</param>
            <param>...</param>
        </schemas>
    </configuration>
</plugin>

Versions

Version
1.3.0
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0