<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2018-2019 toop.eu

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>eu.toop</groupId>
    <artifactId>toop-parent-pom</artifactId>
    <version>1.1.2</version>
  </parent>
  <groupId>eu.toop</groupId>
  <artifactId>toop-simulator</artifactId>
  <name>toop-simulator</name>
  <version>0.10.6</version>
  <packaging>jar</packaging>
  <description>Contains the TOOP Simulator Web Application</description>
  <url>https://github.com/toop4eu/toop-simulator</url>
  <inceptionYear>2019</inceptionYear>

  <properties>
    <main.class.name>eu.toop.simulator.ToopSimulatorMain</main.class.name>
    <toop.version>0.10.6</toop.version>
  </properties>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:toop4eu/toop-simulator.git</connection>
    <developerConnection>scm:git:git@github.com:toop4eu/toop-simulator.git</developerConnection>
    <url>http://github.com/toop4eu/toop-simulator</url>
    <tag>toop-simulator-0.10.6</tag>
  </scm>

  <organization>
    <name>toop.eu</name>
    <url>http://www.toop.eu</url>
  </organization>

  <developers>
    <developer>
      <id>yerlibilgin</id>
      <name>Muhammet Yildiz</name>
      <email>myildiz83(at)gmail.com</email>
    </developer>
  </developers>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>eu.toop</groupId>
        <artifactId>toop-connector-parent-pom</artifactId>
        <version>${toop.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <dependency>
      <groupId>eu.toop</groupId>
      <artifactId>toop-connector</artifactId>
    </dependency>


    <dependency>
      <groupId>eu.toop</groupId>
      <artifactId>toop-commander</artifactId>
      <version>${toop.version}</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>com.typesafe</groupId>
      <artifactId>config</artifactId>
      <version>1.3.3</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.helger</groupId>
      <artifactId>ph-oton-jetty</artifactId>
    </dependency>

    <!-- JUnit 4 for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <targetPath>${project.build.directory}/classes</targetPath>
      </resource>
      <resource>
        <directory>${basedir}/src/main/webapp</directory>
        <targetPath>${project.build.directory}/webapp-classes</targetPath>
      </resource>
      <resource>
        <directory>${basedir}/src/test/resources</directory>
        <targetPath>${project.build.directory}/test-classes</targetPath>
      </resource>
    </resources>

    <defaultGoal>package</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>

            <configuration>
              <createDependencyReducedPom>false</createDependencyReducedPom>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>bundle</shadedClassifierName>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                  <resource>.RSA</resource>
                  <resource>.SF</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>${main.class.name}</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <executions>
          <execution>
            <id>simulator-schema</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <generateDirectory>${project.build.directory}/generated-sources/simulator-schema</generateDirectory>
              <schemaDirectory>${basedir}/src/main/resources/xsd/</schemaDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
