<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    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>
    <artifactId>qa.pipeline</artifactId>
    <groupId>eu.wdaqua.qanary</groupId>
    <version>4.0.0</version>
    <parent>
        <groupId>eu.wdaqua.qanary</groupId>
        <artifactId>mvn.reactor</artifactId>
        <version>4.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <properties>
        <!-- java.version, spring-boot-admin.version, springdoc.version,
             qanary.version, qanary.components.version inherited from parent (tasks 2.1/2.2) -->
        <dockerfile-maven-version>1.4.13</dockerfile-maven-version>
        <docker.image.prefix>qanary</docker.image.prefix>
        <docker.image.name>qanary-pipeline</docker.image.name>
        <docker.platforms>linux/amd64,linux/arm64</docker.platforms>
    </properties>
    <dependencies>
        <dependency>
            <groupId>eu.wdaqua.qanary</groupId>
            <artifactId>qa.commons</artifactId>
            <version>${qanary.version}</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>${spring-boot-admin.version}</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server</artifactId>
            <version>${spring-boot-admin.version}</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server-ui</artifactId>
            <version>${spring-boot-admin.version}</version>
        </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-thymeleaf</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-configuration2</artifactId>
            <version>2.15.1</version>
        </dependency>
        <!-- used directly by QanaryPipelineConfiguration; previously came in
             transitively via Jena 4 (Jena 5 no longer pulls commons-cli) -->
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.9.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-test -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>${springdoc.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>4.0.9</version>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.4</version>
        </dependency>
        <dependency>
            <groupId>eu.wdaqua.qanary</groupId>
            <artifactId>qa.component</artifactId>
            <version>${qanary.components.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <!-- START - Setup for deployment to maven repository -->

    <!-- Project name, Description, URL -->
    <name>${project.groupId}:${project.artifactId}</name> <!--  Assembling name from project and artifact id-->
    <description>Qanary pipeline template package</description>
    <url>https://github.com/WDAqua/Qanary/</url>

    <!-- Source-Control-Management information (SCM) -->
    <scm>
        <connection>scm:git:git://github.com/WDAqua/Qanary.git</connection>
        <developerConnection>scm:git:ssh://github.com/WDAqua/Qanary.git</developerConnection>
        <url>https://github.com/WDAqua/Qanary</url>
    </scm>

    <!-- Developer information -->
    <developers>
        <developer>
            <name>Andreas Both</name>
            <email>andreas.both@htwk-leipzig.de</email>
            <organization>WDAqua</organization>
            <organizationUrl>http://wdaqua.eu/</organizationUrl>
        </developer>
    </developers>

    <!-- Licence information -->
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name> <!-- Example for Apache2 Licence -->
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <!-- Example for Apache2 Licence -->
        </license>
    </licenses>

    <!-- -->
    <!-- END - Setup for deployment to maven repository -->


    <build>
        <plugins>
            <!-- Keep tests from polluting the source tree: redirect the
                 additional-triples output under target/ (cleaned by 'mvn clean',
                 gitignored) instead of the default CWD-relative 'additional-triples'. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <qanary.process.additional-triples-directory>${project.build.directory}/additional-triples</qanary.process.additional-triples-directory>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- JaCoCo scope override: AspectJ weaves the qa.commons dependency
                 into this module's target/classes, so those commons classes
                 would otherwise be (double-)counted here. Restrict coverage
                 measurement/gating to the classes this module actually owns. -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jacoco-report</id>
                        <configuration>
                            <includes>
                                <include>eu/wdaqua/qanary/web/**</include>
                                <include>eu/wdaqua/qanary/QanaryPipeline*.class</include>
                                <include>eu/wdaqua/qanary/QanaryComponentRegistrationChangeNotifier*.class</include>
                                <include>eu/wdaqua/qanary/PipelineExplanationHelper*.class</include>
                                <include>eu/wdaqua/qanary/exceptions/AdditionalTriplesCouldNotBeAdded*.class</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-check</id>
                        <configuration>
                            <includes>
                                <include>eu/wdaqua/qanary/web/**</include>
                                <include>eu/wdaqua/qanary/QanaryPipeline*.class</include>
                                <include>eu/wdaqua/qanary/QanaryComponentRegistrationChangeNotifier*.class</include>
                                <include>eu/wdaqua/qanary/PipelineExplanationHelper*.class</include>
                                <include>eu/wdaqua/qanary/exceptions/AdditionalTriplesCouldNotBeAdded*.class</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>eu.wdaqua.qanary.QanaryPipeline</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>build-info</goal>
                        </goals>
                    </execution>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- https://github.com/fabric8io/docker-maven-plugin -->
            <!-- build Docker image (only for local use): mvn clean install docker:build -->
            <!-- build Docker image and push (for publishing): mvn clean install docker:build
            docker:push -->
            <!-- for pushing to docker hub you need to be signed in -->
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.44.0</version>
                <configuration>
                    <!-- show more logs -->
                    <verbose>true</verbose>
                    <images>
                        <image>
                            <name>${docker.image.prefix}/${docker.image.name}</name>
                            <build>
                                <buildx>
                                    <platforms>
                                        <platform>${docker.platforms}</platform>
                                    </platforms>
                                </buildx>
                                <contextDir>${project.basedir}/</contextDir>
                                <dockerFile>${project.basedir}/Dockerfile</dockerFile>
                                <args>
                                    <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                                </args>
                                <tags>
                                    <tag>${project.version}</tag>
                                    <tag>latest</tag>
                                </tags>
                            </build>
                        </image>
                    </images>
                    <!-- If you do not want to log in to Docker Hub via the console, you can also
                    use your username and password -->
                    <!-- for this it is necessary to use this snipped and to set the env
                    DOCKER_USERNAME and DOCKER_PASSWORD -->
                    <!--                    <authConfig>-->
                    <!--                        <push>-->
                    <!--                            <username>${env.DOCKER_USERNAME}</username>-->
                    <!--                            <password>${env.DOCKER_PASSWORD}</password>-->
                    <!--                        </push>-->
                    <!--                    </authConfig>-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.github.therapi</groupId>
                            <artifactId>therapi-runtime-javadoc-scribe</artifactId>
                            <version>0.15.0</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

            <!-- publishing/signing config inherited from the parent pluginManagement (task 2.2) -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <!--	For Component Cache Tests	-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>dev.aspectj</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.14.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>1.9.25</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <complianceLevel>${java.version}</complianceLevel>
                    <additionalCompilerArgs>
                        <arg>-parameters</arg>
                    </additionalCompilerArgs>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <weaveDependencies>
                        <weaveDependency>
                            <groupId>eu.wdaqua.qanary</groupId>
                            <artifactId>qa.commons</artifactId>
                        </weaveDependency>
                    </weaveDependencies>
                    <verbose>true</verbose>
                    <showWeaveInfo>true</showWeaveInfo>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <!-- No test-compile weave: the parent's shared execution now
                         weaves MAIN classes only (test-compile re-wove the already
                         woven qa.commons and hit AspectJ's "key not found in
                         wovenClassFile" flake). The earlier skip=true execution here
                         was ineffective because the parent's default execution merged
                         the test-compile goal back in; removed now that the parent no
                         longer declares it. -->
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
