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

    <groupId>de.deadlocker8</groupId>
    <artifactId>BudgetMaster</artifactId>
    <version>2.7.1</version>
    <name>BudgetMaster</name>

    <repositories>
        <repository>
            <id>release</id>
            <url>https://maven.thecodelabs.de/artifactory/TheCodeLabs-release</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>snapshots</id>
            <url>https://maven.thecodelabs.de/artifactory/TheCodeLabs-snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.3</version>
        <relativePath/>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>de.thecodelabs</groupId>
                <artifactId>jlibs</artifactId>
                <version>${jlibs.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>11</java.version>

        <jlibs.version>3.2.0</jlibs.version>
        <versionizer.version>3.0.1</versionizer.version>
        <webjars-locator.version>0.41</webjars-locator.version>
        <jquery.version>3.6.0</jquery.version>
        <materializecss.version>1.0.0</materializecss.version>
        <fontawesome.version>5.15.3</fontawesome.version>
        <sortablejs.version>1.13.0</sortablejs.version>
        <mousetrap.version>1.6.5</mousetrap.version>
        <codemirror.version>5.62.0</codemirror.version>
        <selenium.version>3.141.59</selenium.version>
        <assertj-core.version>3.20.2</assertj-core.version>
        <jgit.version>5.12.0.202106070339-r</jgit.version>
        <natorder.version>1.0.2</natorder.version>
        <h2database.version>1.4.199</h2database.version>
        <itextpdf.version>5.5.13.2</itextpdf.version>
        <usertype-core.version>6.0.1.GA</usertype-core.version>
        <joda-time.version>2.10.10</joda-time.version>

        <app.versionDate>${maven.build.timestamp}</app.versionDate>
        <maven.build.timestamp.format>dd.MM.yy</maven.build.timestamp.format>
        <app.versionCode>34</app.versionCode>
        <app.author>Robert Goldmann</app.author>

        <project.outputDirectory>build/${project.version}</project.outputDirectory>
        <project.artifactName>${project.artifactId}-v${project.version}</project.artifactName>
        <project.exe>${project.outputDirectory}/${project.artifactName}.exe</project.exe>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jadira.usertype</groupId>
            <artifactId>usertype.core</artifactId>
            <version>${usertype-core.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>de.thecodelabs</groupId>
            <artifactId>libUtils</artifactId>
        </dependency>

        <dependency>
            <groupId>de.thecodelabs</groupId>
            <artifactId>libStorage</artifactId>
        </dependency>

        <dependency>
            <groupId>de.thecodelabs.versionizer</groupId>
            <artifactId>api</artifactId>
            <version>${versionizer.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>de.thecodelabs</groupId>
                    <artifactId>libLogger-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2database.version}</version>
        </dependency>

        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>${itextpdf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jgit</groupId>
            <artifactId>org.eclipse.jgit</artifactId>
            <version>${jgit.version}</version>
        </dependency>

        <dependency>
            <groupId>org.padler</groupId>
            <artifactId>natorder</artifactId>
            <version>${natorder.version}</version>
        </dependency>

        <!--Webjars-->
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>webjars-locator</artifactId>
            <version>${webjars-locator.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>${jquery.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>materializecss</artifactId>
            <version>${materializecss.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>font-awesome</artifactId>
            <version>${fontawesome.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>sortablejs</artifactId>
            <version>${sortablejs.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>mousetrap</artifactId>
            <version>${mousetrap.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>codemirror</artifactId>
            <version>${codemirror.version}</version>
        </dependency>

        <!-- selenium -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-api</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <outputDirectory>${project.outputDirectory}</outputDirectory>
                    <finalName>${project.artifactName}</finalName>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <webappDirectory>${basedir}/src/main</webappDirectory>
                    <outputDirectory>${project.outputDirectory}</outputDirectory>
                    <warName>${project.artifactName}</warName>
                </configuration>
                <executions>
                    <execution>
                        <id>war-packaging</id>
                        <goals>
                            <goal>war</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.akathist.maven.plugins.launch4j</groupId>
                <artifactId>launch4j-maven-plugin</artifactId>
                <version>1.7.25</version>
                <executions>
                    <execution>
                        <id>l4j-clui</id>
                        <phase>package</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>gui</headerType>
                            <jar>${project.outputDirectory}/${project.artifactName}.jar</jar>
                            <outfile>${project.exe}</outfile>
                            <downloadUrl>https://adoptopenjdk.net/</downloadUrl>
                            <classPath>
                                <mainClass>${project.groupId}${project.artifactId}.Main</mainClass>
                            </classPath>
                            <jre>
                                <bundledJre64Bit>false</bundledJre64Bit>
                                <bundledJreAsFallback>false</bundledJreAsFallback>
                                <minVersion>11</minVersion>
                                <jdkPreference>preferJre</jdkPreference>
                                <runtimeBits>64</runtimeBits>
                            </jre>
                            <icon>build/icon.ico</icon>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <junitArtifactName>junit:junit</junitArtifactName>
                    <argLine>-Dfile.encoding=UTF-8</argLine>

                    <systemPropertyVariables>
                        <testProfile>true</testProfile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <!--Deploy Plugin-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.exe}</file>
                                    <type>exe</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>release</id>
            <name>TheCodeLabs-releases</name>
            <url>https://maven.thecodelabs.de/artifactory/TheCodeLabs-release</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>TheCodeLabs-snapshots</name>
            <url>https://maven.thecodelabs.de/artifactory/TheCodeLabs-snapshots</url>
        </snapshotRepository>
    </distributionManagement>
</project>