<?xml version="1.0" encoding="UTF-8"?>
<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>com.atlassian.asap</groupId>
        <artifactId>asap-parent</artifactId>
        <version>4.0.1</version>
    </parent>

    <artifactId>asap-examples</artifactId>
    <name>ASAP - Examples and benchmarks</name>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.asap</groupId>
            <artifactId>asap-common</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.asap</groupId>
            <artifactId>asap-client-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.asap</groupId>
            <artifactId>asap-server-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.asap</groupId>
            <artifactId>asap-test-common</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>assembly</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>client</id>
            <build>
                <defaultGoal>exec:java</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>com.atlassian.asap.core.client.SimpleClientRunner</mainClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>server</id>
            <build>
                <defaultGoal>exec:java</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>com.atlassian.asap.core.server.SimpleServerRunner</mainClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>benchmark</id>
            <properties>
                <asap.public.key.repo.url>file://${basedir}/src/test/resources/publickeyrepo/</asap.public.key.repo.url>
            </properties>
            <build>
                <defaultGoal>exec:java</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>performance.Benchmark</mainClass>
                            <systemProperties>
                                <systemProperty>
                                    <key>asap.public.key.repo.url</key>
                                    <value>${asap.public.key.repo.url}</value>
                                </systemProperty>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>
</project>
