<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ This file is part of the Yildiz-Engine project, licenced under the MIT License  (MIT)
  ~
  ~  Copyright (c) 2018 Grégory Van den Borre
  ~
  ~  More infos available: https://www.yildiz-games.be
  ~
  ~  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  ~  documentation files (the "Software"), to deal in the Software without restriction, including without
  ~  limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  ~  of the Software, and to permit persons to whom the Software is furnished to do so,
  ~  subject to the following conditions:
  ~
  ~  The above copyright notice and this permission notice shall be included in all copies or substantial
  ~  portions of the Software.
  ~
  ~  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  ~  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  ~  OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM,
  ~  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
  ~
  -->

<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>
  <name>Yildiz Feature Parent Server</name>
  <description>Contains the parent pom for the server features.</description>
  <url>https://bitbucket.org/yildiz-engine-team/parent-feature-server</url>

  <artifactId>parent-feature-server</artifactId>
  <version>1.0.3</version>

  <packaging>pom</packaging>
  <inceptionYear>2017</inceptionYear>
  <scm>
    <connection>scm:git:https://bitbucket.org/yildiz-engine-team/parent-feature-server</connection>
    <developerConnection>scm:git:https://bitbucket.org/yildiz-engine-team/parent-feature-server</developerConnection>
    <url>https://bitbucket.org/yildiz-engine-team/parent-feature-server</url>
  </scm>

  <parent>
    <groupId>be.yildiz-games</groupId>
    <artifactId>parent</artifactId>
    <version>2.2.5</version>
  </parent>

  <properties>
    <feature.package>to-override</feature.package>
  </properties>

  <dependencies>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <version>1.3.2</version>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>generate-from-memory</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>3.6.2</version>
            <configuration>
              <changeLogFile>
                ${basedir}/src/main/resources/database-memory-update-script.xml
              </changeLogFile>
              <driver>org.h2.Driver</driver>
              <url>jdbc:h2:${basedir}/target/database/LIQUIBASE;</url>
              <username>sa</username>
            </configuration>
            <executions>
              <execution>
                <phase>process-resources</phase>
                <goals>
                  <goal>update</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.4.197</version>
              </dependency>
            </dependencies>
          </plugin>
          <plugin>
            <groupId>org.jooq</groupId>
            <artifactId>jooq-codegen-maven</artifactId>
            <executions>
              <execution>
                <phase>process-resources</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.4.197</version>
              </dependency>
            </dependencies>
            <configuration>
              <jdbc>
                <driver>org.h2.Driver</driver>
                <url>jdbc:h2:${basedir}/target/database/LIQUIBASE;</url>
                <user>sa</user>
              </jdbc>
              <generator>
                <name>org.jooq.util.JavaGenerator</name>
                <database>
                  <name>org.jooq.util.h2.H2Database</name>
                  <includes>.*</includes>
                  <excludes>DATABASECHANGELOGLOCK | DATABASECHANGELOG</excludes>
                  <inputSchema>PUBLIC</inputSchema>
                </database>
                <target>
                  <packageName>be.yildizgames.engine.feature.${feature.package}.generated.database</packageName>
                  <directory>src/main/java</directory>
                </target>
              </generator>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
