<!--
  ~ This file is part of the Yildiz-Engine project, licenced under the MIT License  (MIT)
  ~
  ~ Copyright (c) 2017 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: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>
  <name>Yildiz Engine Server</name>
  <description>Server for the Yildiz engine</description>
  <url>https://bitbucket.org/yildiz-engine-team/engine-server</url>

  <artifactId>engine-server</artifactId>
  <version>1.0.0</version>

  <packaging>jar</packaging>
  <inceptionYear>2011</inceptionYear>
  <scm>
    <connection>scm:git:https://bitbucket.org/yildiz-engine-team/engine-server</connection>
    <developerConnection>scm:git:https://bitbucket.org/yildiz-engine-team/engine-server</developerConnection>
    <url>https://bitbucket.org/yildiz-engine-team/engine-server</url>
  </scm>
  <parent>
    <groupId>be.yildiz-games</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.10</version>
  </parent>

  <properties>
    <db.url>default</db.url>
    <db.user>default</db.user>
    <db.password>default</db.password>
    <db.name>default</db.name>
    <db.driver>default</db.driver>
  </properties>

  <profiles>
    <profile>
      <id>dev</id>
      <properties>
        <db.url>jdbc:mysql://localhost:3306</db.url>
        <db.user>yildiz</db.user>
        <db.password>yildiz</db.password>
        <db.name>YILDIZDATABASE</db.name>
        <db.driver>com.mysql.jdbc.Driver</db.driver>
      </properties>
    </profile>
    <profile>
      <id>generate-model</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jooq</groupId>
            <artifactId>jooq-codegen-maven</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>generate</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>6.0.5</version>
              </dependency>
            </dependencies>
            <configuration>
              <jdbc>
                <driver>${db.driver}</driver>
                <url>${db.url}</url>
                <user>${db.user}</user>
                <password>${db.password}</password>
              </jdbc>
              <generator>
                <name>org.jooq.util.JavaGenerator</name>
                <database>
                  <name>org.jooq.util.mysql.MySQLDatabase</name>
                  <includes>.*</includes>
                  <inputSchema>${db.name}</inputSchema>
                </database>
                <target>
                  <packageName>be.yildiz.server.generated.database</packageName>
                  <directory>src/main/java</directory>
                </target>
              </generator>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>be.yildiz-games</groupId>
      <artifactId>engine-shared</artifactId>
    </dependency>
    <dependency>
      <groupId>be.yildiz-games</groupId>
      <artifactId>module-database</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>be.yildiz-games</groupId>
      <artifactId>module-database</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
