<?xml version="1.0" encoding="UTF-8"?>
<!--
  !++
  QDS - Quick Data Signalling Library
  !-
  Copyright (C) 2002 - 2025 Devexperts LLC
  !-
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  !__
  -->
<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>QD</artifactId>
        <groupId>com.devexperts.qd</groupId>
        <version>3.350</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>qd-dataextractor</artifactId>
    <packaging>war</packaging>

    <properties>
        <!--<deploy.file.skip>false</deploy.file.skip>-->
        <!-- public module - deploy to Maven repo  -->
        <deploy.skip>false</deploy.skip>
    </properties>

    <dependencies>
        <!-- dependencies on other modules -->
        <dependency>
            <groupId>com.devexperts.qd</groupId>
            <artifactId>qds</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.devexperts.qd</groupId>
            <artifactId>qds-file</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.devexperts.qd</groupId>
            <artifactId>qds-monitoring</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- external dependencies (provided) -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet-api.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- external dependencies - JSP stuff -->
        <dependency>
            <groupId>org.mortbay.jasper</groupId>
            <artifactId>apache-jsp</artifactId>
            <version>${jasper.version}</version>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons-compress.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-jspc-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>precompile-jsp</id>
                        <goals>
                            <goal>jspc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                    </archive>
                    <!-- SHADED: exclude transitive dependencies used to construct shaded jars qds and dxfeed-api -->
                    <packagingExcludes>${shaded.war.excludes}</packagingExcludes>
                    <outputFileNameMapping>@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
                    <!-- take web.xml from jspc output -->
                    <webXml>${project.build.directory}/web.xml</webXml>
                </configuration>
            </plugin>

            <!-- Copy WAR to the fixed name -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-integration-test-war</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <destFileName>test.war</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
