com.github.dijkstraj:sql-maven-plugin

Execute SQL commands during a Maven build. Can be used to create a database for an integration test.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.github.dijkstraj
ArtifactId

ArtifactId

sql-maven-plugin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

com.github.dijkstraj:sql-maven-plugin
Execute SQL commands during a Maven build. Can be used to create a database for an integration test.
Project URL

Project URL

https://github.com/dijkstraj/sql-maven-plugin
Project Organization

Project Organization

dijkstraj
Source Code Management

Source Code Management

http://github.com/dijkstraj/sql-maven-plugin/tree/master

Download sql-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.dijkstraj</groupId>
    <artifactId>sql-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.0
org.apache.maven : maven-core jar 3.5.0
org.apache.maven.shared : file-management jar 3.0.0
org.jooq : jool jar 0.9.12

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (7)

Group / Artifact Type Version
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
org.apache.maven : maven-aether-provider jar 3.3.9
org.apache.maven : maven-compat jar 3.5.0
org.apache.maven : maven-model jar 3.5.0
com.h2database : h2 jar 1.4.196
org.hamcrest : hamcrest-junit jar 2.0.0.0

Project Modules

There are no modules declared in this project.

sql-maven-plugin

Execute SQL commands during a Maven build. Can be used to create a database for an integration test.

Usage

Add this to your POM to execute your scripts during the verify phase:

<build>
  <plugins>
    <plugin>
      <groupId>com.github.dijkstraj</groupId>
      <artifactId>sql-maven-plugin</artifactId>
      <version>1.0-SNAPSHOT</version>
      <configuration>
        <url>jdbc:mysql://127.0.0.1:3306</url>
        <username>root</username>
        <password>${mysql.root.password}</password>
      </configuration>
      <executions>
        <execution>
          <id>create-databases</id>
          <goals>
            <goal>execute</goal>
          </goals>
          <configuration>
            <fileSet>
              <directory>src/test/sql</directory>
              <includes>
                <include>create-databases.sql</include>
                <include>insert-testdata.sql</include>
              </includes>
            </fileSet>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Versions

Version
1.0