<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- The Basics -->
  <groupId>dev.aulait.jeg</groupId>
  <artifactId>jpa-entity-generator</artifactId>
  <version>0.11</version>
  <packaging>pom</packaging>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <version>2.0.7</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.4.7</version>
    </dependency>

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.26</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>5.9.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <modules>
    <module>jpa-entity-generator-core</module>
    <module>jpa-entity-generator-db</module>
    <module>jpa-entity-generator-docs</module>
    <module>jpa-entity-generator-maven-plugin</module>
  </modules>

  <properties>
    <ant.file>build.xml</ant.file>
    <ant.target>setup-db</ant.target>

    <core.mainClass>dev.aulait.jeg.core.interfaces.Main</core.mainClass>

    <db.dbms>postgres</db.dbms>
    <db.healthcheck>pg_isready -d postgres -U postgres</db.healthcheck>
    <db.image>postgres</db.image>
    <db.jdbc.groupId>org.postgresql</db.jdbc.groupId>
    <db.jdbc.artifactId>postgresql</db.jdbc.artifactId>
    <db.jdbc.version>42.7.2</db.jdbc.version>
    <db.jdbc.url>jdbc:postgresql://${db.host}:${db.port.host}/${db.name}?currentSchema=${db.schema}</db.jdbc.url>
    <db.password>jeg</db.password>
    <db.host>localhost</db.host>
    <db.name>jeg</db.name>
    <db.port.host>5438</db.port.host>
    <db.port.container>5432</db.port.container>
    <db.schema>jeg</db.schema>
    <db.username>jeg</db.username>

    <jeg.outputDir>${project.build.directory}/generated-test-resources/jeg</jeg.outputDir>

    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <argLine />
  </properties>

  <build>
    <defaultGoal>antrun:run</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>

        <inherited>false</inherited>
        <configuration>
          <target>
            <ant antfile="${ant.file}" target="${ant.target}" />
          </target>
        </configuration>
      </plugin>
    </plugins>


    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
          <inherited>false</inherited>
          <dependencies>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant</artifactId>
              <version>1.10.14</version>
            </dependency>
            <dependency>
              <groupId>ant-contrib</groupId>
              <artifactId>ant-contrib</artifactId>
              <version>1.0b3</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.2.1</version>
          <configuration>
            <argLine>
              @{argLine}
              --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
              --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
              --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
              --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
              --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
              --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
            </argLine>
            <forkCount>1</forkCount>
            <reuseForks>false</reuseForks>
          </configuration>
        </plugin>

        <plugin>
          <groupId>dev.aulait.bt</groupId>
          <artifactId>batch-translator-maven-plugin</artifactId>
          <version>1.0.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>


  <!-- More Project Information -->
  <name>jpa-entity-generator</name>
  <description>JPA Entity Generator</description>
  <url>https://aulait.dev</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>yuichi.kuwahara</id>
      <name>Yuichi Kuwahara</name>
      <email>yuichi.kuwahara.0@gmail.com</email>
    </developer>
  </developers>


  <!-- Environment Settings -->
  <scm>
    <connection>scm:git:git//github.com/project-au-lait/jpa-entity-generator.git</connection>
    <developerConnection>scm:git:git//github.com/project-au-lait/jpa-entity-generator.git</developerConnection>
    <url>https://github.com/project-au-lait/jpa-entity-generator.git</url>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>github</id>
      <name>GitHub Project Au Lait Apache Maven Packages</name>
      <url>https://maven.pkg.github.com/project-au-lait/jpa-entity-generator</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>release</id>

      <properties>
        <maven.test.skip>true</maven.test.skip>
      </properties>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.8.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>maven-central</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.5.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <excludeArtifacts>jpa-entity-generator-docs,jpa-entity-generator-db</excludeArtifacts>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>analyze</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.12</version>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>default-report</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>


    <profile>
      <id>dbms-h2</id>

      <activation>
        <property>
          <name>env.JEG_DBMS</name>
          <value>h2</value>
        </property>
      </activation>

      <properties>
        <db.dbms>h2</db.dbms>
        <db.healthcheck>curl --fail http://localhost:81</db.healthcheck>
        <db.image>oscarfonts/h2</db.image>
        <db.jdbc.groupId>com.h2database</db.jdbc.groupId>
        <db.jdbc.artifactId>h2</db.jdbc.artifactId>
        <db.jdbc.version>2.3.232</db.jdbc.version>
        <db.jdbc.url>
          jdbc:h2:tcp://${db.host}:${db.port.host}/${db.name};CASE_INSENSITIVE_IDENTIFIERS=TRUE</db.jdbc.url>
        <db.port.host>1521</db.port.host>
        <db.port.container>1521</db.port.container>
        <db.schema>PUBLIC</db.schema>
      </properties>
    </profile>
  </profiles>
</project>