<?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">
    <parent>
        <artifactId>BudgetMaster</artifactId>
        <groupId>de.deadlocker8</groupId>
        <version>2.10.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>BudgetMasterServer</artifactId>

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

    <properties>
        <jlibs.version>3.2.0</jlibs.version>
        <versionizer.version>3.0.1</versionizer.version>
        <webjars-locator.version>0.45</webjars-locator.version>
        <jquery.version>3.6.0</jquery.version>
        <materializecss.version>1.0.0</materializecss.version>
        <fontawesome.version>6.1.0</fontawesome.version>
        <sortablejs.version>1.14.0</sortablejs.version>
        <mousetrap.version>1.6.5</mousetrap.version>
        <codemirror.version>5.62.2</codemirror.version>
        <selenium.version>4.1.3</selenium.version>
        <assertj-core.version>3.22.0</assertj-core.version>
        <jgit.version>6.1.0.202203080745-r</jgit.version>
        <natorder.version>1.1.2</natorder.version>
        <h2database.version>1.4.199</h2database.version>
        <itextpdf.version>5.5.13.3</itextpdf.version>
        <vanilla-picker.version>2.12.1</vanilla-picker.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <dependency-check-maven.version>6.5.3</dependency-check-maven.version>

        <project.outputDirectory>build/${project.version}</project.outputDirectory>
        <project.artifactName>${project.artifactId}-v${project.version}</project.artifactName>
    </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-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>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>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </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>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>vanilla-picker</artifactId>
            <version>${vanilla-picker.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.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
            <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.2</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>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <junitArtifactName>junit:junit</junitArtifactName>
                    <argLine>${surefireArgLine} -Dfile.encoding=UTF-8</argLine>

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

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>aggregate-reports-all</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <title>BudgetMaster Code Coverage</title>
                        </configuration>
                    </execution>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${dependency-check-maven.version}</version>
                <inherited>false</inherited>
                <configuration>
                    <skip>false</skip>
                    <cveValidForHours>48</cveValidForHours>
                    <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                    <failOnError>false</failOnError>
                    <formats>
                        <format>HTML</format>
                        <format>XML</format>
                    </formats>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>