<?xml version="1.0"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>us.fatehi</groupId>
    <artifactId>schemacrawler-parent</artifactId>
    <version>16.16.3</version>
    <relativePath>../schemacrawler-parent/pom.xml</relativePath>
  </parent>
  <artifactId>schemacrawler-docker-compose</artifactId>
  <packaging>pom</packaging>
  <name>SchemaCrawler - Docker Compose with Various Databases</name>
  <dependencies>
    <dependency>
      <groupId>us.fatehi</groupId>
      <artifactId>schemacrawler-distrib</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>us.fatehi</groupId>
      <artifactId>schemacrawler-docker</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.0.0</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant</artifactId>
              <version>1.10.9</version>
            </dependency>
            <dependency>
              <groupId>org.apache.ivy</groupId>
              <artifactId>ivy</artifactId>
              <version>2.5.0</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-testdb</id>
            <phase>package</phase>
            <configuration>
              <target name="copy-testdb"
                description="Copy test database and creation scripts for use with Docker Compose">
                <property name="SchemaCrawler.home"
                  location=".." />
                <property name="SchemaCrawler.version"
                  value="${project.version}" />
                <mkdir dir="${project.build.directory}" />
                <copy todir="${project.build.directory}">
                  <fileset
                    dir="${SchemaCrawler.home}/schemacrawler-distrib/target/_main-distribution/_testdb">
                    <include name="**/*.*" />
                  </fileset>
                </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
