<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-server-parent</artifactId>
        <version>9.0.2.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>infinispan-server-router</artifactId>
    <packaging>bundle</packaging>
    <name>Infinispan Multi Tenant Router</name>
    <description>Infinispan Multi Tenant Router</description>

    <properties>
        <module.skipComponentMetaDataProcessing>false</module.skipComponentMetaDataProcessing>
        <suite.exclude.groups>org.infinispan.commons.test.annotations.Profiling</suite.exclude.groups>
        <certificate.dname>CN=HotRod_1,OU=Infinispan,O=JBoss,L=Red Hat,ST=World,C=WW</certificate.dname>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>infinispan-server-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>infinispan-client-hotrod</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>infinispan-server-hotrod</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>infinispan-server-hotrod</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>infinispan-server-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>keytool-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-server</id>
                        <goals>
                            <goal>generateKeyPair</goal>
                        </goals>
                        <phase>generate-test-resources</phase>
                        <configuration>
                            <alias>default</alias>
                            <keystore>${project.build.testOutputDirectory}/default_server_keystore.jks</keystore>
                            <dname>${certificate.dname}</dname>
                        </configuration>
                    </execution>
                    <execution>
                        <id>sni_server</id>
                        <goals>
                            <goal>generateKeyPair</goal>
                        </goals>
                        <phase>generate-test-resources</phase>
                        <configuration>
                            <alias>default</alias>
                            <keystore>${project.build.testOutputDirectory}/sni_server_keystore.jks</keystore>
                            <dname>${certificate.dname}</dname>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-client</id>
                        <goals>
                            <goal>importKeystore</goal>
                        </goals>
                        <phase>generate-test-resources</phase>
                        <configuration>
                            <srckeystore>${project.build.testOutputDirectory}/default_server_keystore.jks</srckeystore>
                            <srcstorepass>secret</srcstorepass>
                            <destkeystore>${project.build.testOutputDirectory}/default_client_truststore.jks</destkeystore>
                            <deststorepass>secret</deststorepass>
                        </configuration>
                    </execution>
                    <execution>
                        <id>sni-client</id>
                        <goals>
                            <goal>importKeystore</goal>
                        </goals>
                        <phase>generate-test-resources</phase>
                        <configuration>
                            <srckeystore>${project.build.testOutputDirectory}/sni_server_keystore.jks</srckeystore>
                            <srcstorepass>secret</srcstorepass>
                            <destkeystore>${project.build.testOutputDirectory}/sni_client_truststore.jks</destkeystore>
                            <deststorepass>secret</deststorepass>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <storepass>secret</storepass>
                    <keypass>secret</keypass>
                    <keysize>2048</keysize>
                    <keyalg>RSA</keyalg>
                    <validity>365</validity>
                    <noprompt>true</noprompt>
                    <trustcacerts>true</trustcacerts>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration combine.self="override">
                    <trimStackTrace>false</trimStackTrace>
                    <parallel>suitesAndClasses</parallel>
                    <threadCount>${infinispan.test.parallel.threads}</threadCount>
                    <excludedGroups>${suite.exclude.groups}</excludedGroups>
                    <systemPropertyVariables>
                        <log4j.configurationFile>${log4j.configurationFile}</log4j.configurationFile>
                        <build.directory>${project.build.directory}</build.directory>
                    </systemPropertyVariables>
                    <argLine>${forkJvmArgs} ${jigsawForkJvmArgs}</argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${version.maven.surefire}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>
                            ${project.groupId}.server.router.*;version=${project.version};-split-package:=error
                        </Export-Package>
                    </instructions>
                </configuration>
            </plugin>

            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean-key-stores</id>
                        <phase>process-test-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <delete quiet="true">
                                    <fileset dir="${project.build.testOutputDirectory}" includes="*.jks" />
                                </delete>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>