<?xml version="1.0"?>
<!--

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

    <modelVersion>4.0.0</modelVersion>

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

    <artifactId>exist-expathrepo-trigger-test</artifactId>
    <packaging>jar</packaging>

    <name>eXist-db EXPath Repository Module - Trigger Tests</name>
    <description>eXist-db XQuery EXPath Repository Module - Trigger Tests</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>

    <properties>
        <!-- used in the EXPath Package Descriptor -->
        <package-name>https://my-organisation.com/exist-db/app</package-name>
        <example.module.namespace>https://my-organisation.com/exist-db/ns/app/my-java-module</example.module.namespace>
        <example.module.java.classname>ExampleModule</example.module.java.classname>
    </properties>

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

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

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/xar-resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>templates/**</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/xar-resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>templates/**</exclude>
                </excludes>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>*.xsl</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>${project.build.directory}/generated-test-resources</directory>
                <filtering>false</filtering>
            </testResource>
        </testResources>

        <plugins>
            <!--
                Generates this module's test conf.xml from the canonical
                exist-distribution/.../conf.xml via src/test/resources/conf-fixture.xsl (which
                imports schema/generate-conf-fixture.xsl, see that stylesheet's header). Runs
                before process-test-resources. No ${basedir}-style Maven token in this fixture's
                content (its data-path is the literal "webapp/WEB-INF/data"), so filtering=false
                is fine here, unlike most other fixtures.
            -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>conf-fixture-codegen</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                        <configuration>
                            <forceCreation>true</forceCreation>
                            <transformationSets>
                                <transformationSet>
                                    <dir>${project.basedir}/../../../../exist-distribution/src/main/config</dir>
                                    <includes>
                                        <include>conf.xml</include>
                                    </includes>
                                    <stylesheet>${project.basedir}/src/test/resources/conf-fixture.xsl</stylesheet>
                                    <outputDir>${project.build.directory}/generated-test-resources</outputDir>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>ro.kuberam.maven.plugins</groupId>
                <artifactId>kuberam-expath-plugin</artifactId>
                <version>0.6.3</version>
                <executions>
                    <execution>
                        <id>create-xar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>make-xar</goal>
                        </goals>
                        <configuration>
                            <descriptor>xar-assembly.xml</descriptor>
                            <finalName>${package-final-name}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <!-- This module should never be deployed -->
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
