<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (c) 2015-2024 tracetronic GmbH

  SPDX-License-Identifier: BSD-3-Clause
  -->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>4.87</version>
        <relativePath />
    </parent>

    <groupId>de.tracetronic.jenkins.plugins</groupId>
    <artifactId>ecutest</artifactId>
    <version>2.45</version>
    <packaging>hpi</packaging>

    <name>tracetronic ecu.test Plugin</name>
    <description>This plugin integrates Jenkins with ecu.test and generates reports on automated test execution.</description>
    <url>https://github.com/jenkinsci/ecutest-plugin</url>
    <inceptionYear>2015</inceptionYear>
    <organization>
        <name>tracetronic GmbH</name>
        <url>https://www.tracetronic.de</url>
    </organization>
    <licenses>
        <license>
            <name>The BSD 3-Clause License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
            <comments>All source code is under the BSD license.</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>cpoenisch</id>
            <name>Christian Pönisch</name>
            <email>christian.poenisch@tracetronic.de</email>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>TT-S3-D1</id>
            <name>Sebastian Dietze</name>
            <email>sebastian.dietze@tracetronic.de</email>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>MartinGroscheTT</id>
            <name>Martin Grosche</name>
            <email>martin.grosche@tracetronic.de</email>
            <timezone>+1</timezone>
        </developer>
        <developer>
            <id>ErikRehmTT</id>
            <name>Erik Rehm</name>
            <email>erik.rehm@tracetronic.de</email>
            <timezone>+1</timezone>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <url>https://github.com/jenkinsci/ecutest-plugin/graphs/contributors</url>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
        <developerConnection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</developerConnection>
        <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
        <tag>ecutest-2.45</tag>
    </scm>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/jenkinsci/ecutest-plugin/issues</url>
    </issueManagement>
    <ciManagement>
        <system>Jenkins</system>
        <url>https://ci.jenkins.io/job/plugins/job/ecutest-plugin</url>
    </ciManagement>

    <properties>
        <!-- Jenkins base -->
        <jenkins.version>2.426.3</jenkins.version>
        <javaTargetJDK>17</javaTargetJDK>

        <maven.compiler.release>${javaTargetJDK}</maven.compiler.release>

        <!-- Jenkins plugins -->
        <job-dsl.version>1.87</job-dsl.version>
        <warnings-ng.version>11.4.1</warnings-ng.version>

        <!-- Direct dependencies -->
        <jacob.version>1.20</jacob.version>
        <antlr4-maven-plugin.version>4.13.2</antlr4-maven-plugin.version>
        <antlr4-runtime.version>4.13.2</antlr4-runtime.version>
        <sqlite-jdbc.version>3.45.3.0</sqlite-jdbc.version>
        <spotbugs-annotations.version>4.8.6</spotbugs-annotations.version>

        <!-- Static code analysis -->
        <maven-checkstyle-plugin.version>3.5.0</maven-checkstyle-plugin.version>
        <checkstyle.version>10.18.1</checkstyle.version>
        <maven-pmd-plugin.version>3.25.0</maven-pmd-plugin.version>
        <spotbugs.effort>Max</spotbugs.effort>
        <spotbugs.threshold>Low</spotbugs.threshold>

        <!-- Compliance -->
        <cyclonedx.version>2.8.1</cyclonedx.version>

        <!-- Test scope -->
        <equalsverifier.version>3.16.2</equalsverifier.version>
        <concurrency>2</concurrency>
        <skipUTs>false</skipUTs>
        <skipITs>true</skipITs>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.jenkins.tools.bom</groupId>
                <artifactId>bom-2.426.x</artifactId>
                <version>3208.vb_21177d4b_cd9</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.jenkins.plugins</groupId>
                <artifactId>echarts-api</artifactId>
                <version>5.5.1-1</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.36</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>2.17.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.17.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <!-- Direct dependencies -->
        <dependency>
            <groupId>com.jacob</groupId>
            <artifactId>jacob</artifactId>
            <version>${jacob.version}</version>
        </dependency>
        <dependency>
            <groupId>com.jacob</groupId>
            <artifactId>jacob</artifactId>
            <version>${jacob.version}</version>
            <type>dll</type>
            <classifier>x86</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.jacob</groupId>
            <artifactId>jacob</artifactId>
            <version>${jacob.version}</version>
            <type>dll</type>
            <classifier>x64</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
            <version>${antlr4-runtime.version}</version>
        </dependency>
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>${sqlite-jdbc.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
            <version>${spotbugs-annotations.version}</version>
        </dependency>

        <!-- Jenkins plugins -->
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>credentials</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>jquery</artifactId>
            <version>1.12.4-1</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>matrix-project</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>script-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>structs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-cps</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-step-api</artifactId>
        </dependency>

        <!-- Jenkins optional plugins -->
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>job-dsl</artifactId>
            <version>${job-dsl.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
            </exclusions>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>junit</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.jenkins.plugins</groupId>
            <artifactId>warnings-ng</artifactId>
            <version>${warnings-ng.version}</version>
            <optional>true</optional>
        </dependency>

        <!-- Compliance -->
        <dependency>
            <groupId>org.cyclonedx</groupId>
            <artifactId>cyclonedx-maven-plugin</artifactId>
            <version>${cyclonedx.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-core</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>

        <!-- Test scope -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>nl.jqno.equalsverifier</groupId>
            <artifactId>equalsverifier</artifactId>
            <version>${equalsverifier.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Pipeline test scope -->
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-job</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-support</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-basic-steps</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-durable-task-step</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-step-api</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.jenkins</groupId>
            <artifactId>configuration-as-code</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.jenkins.configuration-as-code</groupId>
            <artifactId>test-harness</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>lib</id>
            <url>file://${project.basedir}/lib</url>
        </repository>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                    <excludes>
                        <exclude>InjectedTest.java</exclude>
                    </excludes>
                    <!-- <argLine>@{argLine}</argLine> -->
                    <skipTests>${skipUTs}</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*IT.java</include>
                        <include>InjectedTest.java</include>
                    </includes>
                    <!--<argLine>@{argLine}</argLine> -->
                    <forkCount>${concurrency}</forkCount>
                    <reuseForks>true</reuseForks>
                    <skipITs>${skipITs}</skipITs>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <doclint>none</doclint>
                    <sourceFileExcludes>
                        <exclude>**/Messages.java</exclude>
                        <exclude>**/RefFilter*.java</exclude>
                    </sourceFileExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>${basedir}/.mvn/checkstyle-config.xml</configLocation>
                    <suppressionsLocation>${basedir}/.mvn/checkstyle-exclude.xml</suppressionsLocation>
                    <consoleOutput>true</consoleOutput>
                </configuration>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <logViolationsToConsole>true</logViolationsToConsole>
                            <failOnViolation>true</failOnViolation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <excludeFilterFile>.mvn/spotbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${maven-pmd-plugin.version}</version>
                <configuration>
                    <analysisCache>true</analysisCache>
                    <minimumTokens>200</minimumTokens>
                    <targetJdk>${javaTargetJDK}</targetJdk>
                    <linkXRef>false</linkXRef>
                    <excludeRoots>
                        <excludeRoot>target/generated-sources/antlr4</excludeRoot>
                        <excludeRoot>target/generated-sources/localizer</excludeRoot>
                    </excludeRoots>
                </configuration>
                <executions>
                    <execution>
                        <id>pmd</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>pmd-cpd</id>
                        <goals>
                            <goal>cpd-check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <version>${antlr4-maven-plugin.version}</version>
                <configuration>
                    <listener>false</listener>
                    <visitor>false</visitor>
                </configuration>
                <executions>
                    <execution>
                        <id>antlr</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <excludeTransitive>true</excludeTransitive>
                            <includeArtifactIds>jacob</includeArtifactIds>
                            <includeTypes>dll</includeTypes>
                            <outputDirectory>target/${project.artifactId}/WEB-INF/lib</outputDirectory>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
                <version>${cyclonedx.version}</version>
                <configuration>
                    <projectType>library</projectType>
                    <schemaVersion>1.4</schemaVersion>
                    <outputFormat>json</outputFormat>
                    <outputName>sbom</outputName>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>makeAggregateBom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>fast</id>
            <properties>
                <skipUTs>true</skipUTs>
                <skipITs>true</skipITs>
                <checkstyle.skip>true</checkstyle.skip>
                <pmd.skip>true</pmd.skip>
                <spotbugs.skip>true</spotbugs.skip>
                <maven.javadoc.skip>true</maven.javadoc.skip>
            </properties>
        </profile>
    </profiles>
</project>
