<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>

    <groupId>${groupId}</groupId>
    <artifactId>${artifactId}</artifactId>
    <name>${appName}</name>
    <version>${version}</version>
    <packaging>jar</packaging>

    <scm>
        <!-- TODO: Change this to your SCM URL -->
        <connection>scm:git:https://github.com/4treesCH/strolch.git</connection>
        <developerConnection>scm:git:https://github.com/4treesCH/strolch.git</developerConnection>
        <url>https://github.com/4treesCH/strolch</url>
    </scm>

    <properties>
        <appFinalName>${artifactId}</appFinalName>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
        <buildTimestamp>${maven.build.timestamp}</buildTimestamp>

        <jdk.version>17</jdk.version>

        <!-- compile time dependencies -->
        <slf4j.version>1.7.30</slf4j.version>
        <logback.version>1.2.9</logback.version>
        <gson.version>2.8.9</gson.version>
        
        <strolch.version>1.7.0-SNAPSHOT</strolch.version>

        <!-- test time dependencies -->
        <junit.version>4.13.2</junit.version>
        <hamcrest.version>2.2</hamcrest.version>

        <!-- maven plug-in dependencies -->
        <maven-scm-plugin.version>1.12.2</maven-scm-plugin.version>
        <buildnumber-maven-plugin.version>3.0.0</buildnumber-maven-plugin.version>
        <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-site-plugin.version>3.10.0</maven-site-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-war-plugin.version>3.3.2</maven-war-plugin.version>
        <tomcat7-maven-plugin.version>2.2</tomcat7-maven-plugin.version>
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M2</maven-deploy-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
        <maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.12</nexus-staging-maven-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
        <archetype-packaging.version>3.2.0</archetype-packaging.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>li.strolch</groupId>
                <artifactId>li.strolch.bom</artifactId>
                <type>pom</type>
                <version>${strolch.version}</version>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>runtime</scope>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <!-- test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- base -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

        <!-- strolch -->
        <dependency>
            <groupId>li.strolch</groupId>
            <artifactId>li.strolch.model</artifactId>
        </dependency>
        <dependency>
            <groupId>li.strolch</groupId>
            <artifactId>li.strolch.agent</artifactId>
        </dependency>
        <dependency>
            <groupId>li.strolch</groupId>
            <artifactId>li.strolch.service</artifactId>
        </dependency>
        <dependency>
            <groupId>li.strolch</groupId>
            <artifactId>li.strolch.testbase</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${appFinalName}</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/*.properties</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>${buildnumber-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <compilerArgument>-Xlint:all</compilerArgument>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <configuration>
                    <mainClass>${package}.Main</mainClass>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <profiles>

        <!-- for dev: always enable strolch environment "dev" -->
        <profile>
            <id>dev.local</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <strolch.env>dev</strolch.env>
            </properties>
        </profile>

    </profiles>
</project>
