<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>ch.so.agi.gretl</groupId>
    <artifactId>gretl-runtime-parent</artifactId>
    <version>0.1.0-SNAPSHOT</version>
  </parent>
  <artifactId>gretl-database-tasks</artifactId>
  <packaging>jar</packaging>
  <name>GRETL Database Tasks</name>
  <description>SQL, Db2Db and DuckDB task library.</description>
  <dependencies>
    <dependency>
      <groupId>ch.so.agi.gretl</groupId>
      <artifactId>gretl-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>ch.so.agi.gretl</groupId>
      <artifactId>gretl-i18n</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${postgresql.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.duckdb</groupId>
      <artifactId>duckdb_jdbc</artifactId>
      <version>${duckdb.version}</version>
    </dependency>
    <dependency>
      <groupId>ch.so.agi.gretl</groupId>
      <artifactId>gretl-runner</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.3.232</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>production-module-boundary</id>
            <phase>validate</phase><goals><goal>enforce</goal></goals>
            <configuration><rules><bannedDependencies>
              <searchTransitive>true</searchTransitive>
              <message>Production dependencies inside GRETL are limited to API and i18n; test dependencies remain separate.</message>
              <excludes><exclude>ch.so.agi.gretl:*:*:*:compile</exclude><exclude>ch.so.agi.gretl:*:*:*:runtime</exclude><exclude>ch.so.agi.gretl:*:*:*:provided</exclude></excludes>
              <includes><include>ch.so.agi.gretl:gretl-api</include><include>ch.so.agi.gretl:gretl-i18n</include></includes>
            </bannedDependencies></rules></configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>ch.so.agi.gretl.tasks.database</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
