<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    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>org.xipki.assembly</groupId>
    <artifactId>assemblies</artifactId>
    <version>5.3.14</version>
  </parent>
  <artifactId>xipki-dbtool</artifactId>
  <packaging>pom</packaging>
  <name>XiPKI :: assembly :: ${project.artifactId}</name>
  <properties>
    <shared.dir>${project.basedir}/../shared</shared.dir>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.xipki</groupId>
      <artifactId>dbtool</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.mariadb.jdbc</groupId>
      <artifactId>mariadb-java-client</artifactId>
      <version>${jdbc.mariadb.version}</version>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${jdbc.postgresql.version}</version>
    </dependency>
    <dependency>
      <groupId>org.tinylog</groupId>
      <artifactId>slf4j-tinylog</artifactId>
      <version>${tinylog.version}</version>
    </dependency>
    <dependency>
      <groupId>org.tinylog</groupId>
      <artifactId>tinylog-impl</artifactId>
      <version>${tinylog.version}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <!-- Extract the SQL scripts -->
            <id>unpack-sql</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>org.xipki</groupId>
                  <artifactId>ca-server</artifactId>
                  <version>${project.version}</version>
                  <includes>sql/*-init.xml</includes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.xipki</groupId>
                  <artifactId>ocsp-server</artifactId>
                  <version>${project.version}</version>
                  <includes>sql/*-init.xml</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>bin-main</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/descriptors/main.xml</descriptor>
              </descriptors>
              <appendAssemblyId>false</appendAssemblyId>
              <attach>false</attach>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
