<?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</artifactId>
  <packaging>pom</packaging>
  <name>SchemaCrawler - Docker Image</name>
  <properties>
    <docker.skip>true</docker.skip>
  </properties>
  <dependencies>
    <dependency>
      <groupId>us.fatehi</groupId>
      <artifactId>schemacrawler-distrib</artifactId>
      <version>${project.version}</version>
	  <type>pom</type>
    </dependency>
  </dependencies>    
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>docker-build</id>
            <phase>package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <skip>${docker.skip}</skip>
              <executable>docker</executable>
              <workingDirectory>${project.basedir}</workingDirectory>
              <arguments>
                <argument>build</argument>
                <argument>-f</argument>
                <argument>${project.basedir}/Dockerfile</argument>
                <argument>-t</argument>
                <argument>schemacrawler/schemacrawler:v${project.version}</argument>
                <argument>-t</argument>
                <argument>schemacrawler/schemacrawler:latest</argument>
                <argument>${project.basedir}/../schemacrawler-distrib/target/_expanded-distribution</argument>
              </arguments>
            </configuration>
          </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>
