<?xml version="1.0" encoding="UTF-8"?>
<!--

    eXist-db Open Source Native XML Database
    Copyright (C) 2001 The eXist-db Authors

    info@exist-db.org
    http://www.exist-db.org

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.exist-db</groupId>
        <artifactId>exist-parent</artifactId>
        <version>7.0.0-beta4</version>
        <relativePath>../../exist-parent</relativePath>
    </parent>

    <artifactId>exist-webdav</artifactId>
    <packaging>jar</packaging>

    <name>eXist-db WebDAV Extension</name>
    <description>eXist-db NoSQL Database WebDAV Extension</description>

    <scm>
        <connection>scm:git:https://github.com/exist-db/exist.git</connection>
        <developerConnection>scm:git:https://github.com/exist-db/exist.git</developerConnection>
        <url>scm:git:https://github.com/exist-db/exist.git</url>
      <tag>HEAD</tag>
  </scm>

    <dependencies>
        <dependency>
            <groupId>org.exist-db</groupId>
            <artifactId>exist-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!--
            Enforce transient dependency to an explicit version.
        -->
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.11.0</version>
        </dependency>

        <!-- Jackrabbit WebDAV (Jakarta EE 10 transformed) -->
        <dependency>
            <groupId>org.exist-db.thirdparty.org.apache.jackrabbit</groupId>
            <artifactId>jackrabbit-webdav</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- needed for starting up a jetty server -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-deploy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jmx</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>exist-jetty-config</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/*-fixture.xsl</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>src/test/resources-filtered</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>*.xsl</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>${project.build.directory}/generated-test-resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <!--
                Generates this module's test controller-config.xml from the canonical
                standalone-webapp/WEB-INF/controller-config.xml via the fixture stylesheet.
                conf.xml codegen is handled by the root pom's conf-fixture-codegen profile.
            -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>controller-config-fixture-codegen</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                        <configuration>
                            <forceCreation>true</forceCreation>
                            <transformationSets>
                                <transformationSet>
                                    <dir>${maven.multiModuleProjectDirectory}/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF</dir>
                                    <includes>
                                        <include>controller-config.xml</include>
                                    </includes>
                                    <stylesheet>${project.basedir}/src/test/resources/standalone-webapp/WEB-INF/controller-config-fixture.xsl</stylesheet>
                                    <outputDir>${project.build.directory}/generated-test-resources/standalone-webapp/WEB-INF</outputDir>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>commons-beanutils:commons-beanutils</ignoredUnusedDeclaredDependency>

                                <!-- needed for running tests that depend on eXist-db Jetty server -->
                                <ignoredUnusedDeclaredDependency>${project.groupId}:exist-jetty-config:jar:${project.version}</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.eclipse.jetty:jetty-util:jar:${jetty.version}</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.eclipse.jetty:jetty-deploy:jar:${jetty.version}</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.eclipse.jetty:jetty-jmx:jar:${jetty.version}</ignoredUnusedDeclaredDependency>

                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <licenseSets>
                        <licenseSet>
                            <excludes>
                                <exclude>src/test/resources/litmus-baseline.txt</exclude>
                                <exclude>src/test/resources/litmus-check.sh</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>@{jacocoArgLine}</argLine>
                    <systemPropertyVariables>
                        <jetty.home>${project.basedir}/../../exist-jetty-config/target/classes/org/exist/jetty</jetty.home>
                        <exist.configurationFile>${project.build.testOutputDirectory}/conf.xml</exist.configurationFile>
                        <exist.jetty.standalone.webapp.dir>${project.build.testOutputDirectory}/standalone-webapp</exist.jetty.standalone.webapp.dir>
                        <log4j.configurationFile>${exist.log4j.testConfigurationFile}</log4j.configurationFile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
