<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>

    <groupId>com.fizzed</groupId>
    <artifactId>ninja-undertow</artifactId>
    <packaging>jar</packaging>
    
    <parent>
        <groupId>com.fizzed</groupId>
        <artifactId>ninja-undertow-parent</artifactId>
        <version>6.2.2-1</version>
    </parent>

    <!-- only required for unit testing h2 w/ okhttp -->
    <!--
    <properties>
        <jetty.alpnAgent.version>2.0.0</jetty.alpnAgent.version>
        <jetty.alpnAgent.path>${settings.localRepository}/org/mortbay/jetty/alpn/jetty-alpn-agent/${jetty.alpnAgent.version}/jetty-alpn-agent-${jetty.alpnAgent.version}.jar</jetty.alpnAgent.path>
    </properties>
    -->

    <!--
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>get-jetty-alpn-agent</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>get</goal>
                        </goals>
                        <configuration>
                            <groupId>org.mortbay.jetty.alpn</groupId>
                            <artifactId>jetty-alpn-agent</artifactId>
                            <version>${jetty.alpnAgent.version}</version>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <argLine>-javaagent:${jetty.alpnAgent.path}</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>
    -->
    
    <profiles>
        <profile>
            <id>ninja-undertow-exec</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.5.0</version>
                        <executions>
                            <execution>
                                <id>ninja-undertow-exec</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>java</executable>
                                    <arguments>
                                        <!--<argument>-javaagent:${jetty.alpnAgent.path}</argument>-->
                                        <argument>-cp</argument>
                                        <classpath />
                                        <argument>${exec.mainClass}</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>

        <dependency>
            <groupId>org.ninjaframework</groupId>
            <artifactId>ninja-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.undertow</groupId>
            <artifactId>undertow-core</artifactId>
        </dependency>

        <!-- testing -->
              
        <!--
        <dependency>
            <groupId>org.mortbay.jetty.alpn</groupId>
            <artifactId>alpn-boot</artifactId>
            <version>8.1.9.v20160720</version>
            <scope>test</scope>
        </dependency>
        -->
        
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>java-hamcrest</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.ninjaframework</groupId>
            <artifactId>ninja-standalone</artifactId>
            <scope>test</scope>
        </dependency>
        
    </dependencies>
    
</project>
