<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.bagridb</groupId>
        <artifactId>bagri</artifactId>
        <version>1.2.0</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>bagri-rest</artifactId>
    <name>bagri-rest</name>
    <description>Bagri REST Server</description>

    <dependencies>

        <dependency>
            <groupId>com.bagridb</groupId>
            <artifactId>bagri-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.bagridb</groupId>
            <artifactId>bagri-xqj</artifactId>
        </dependency>
        <dependency>
            <groupId>com.bagridb</groupId>
            <artifactId>bagri-xquery-saxon</artifactId>
        </dependency>
        <dependency>
            <groupId>com.bagridb</groupId>
            <artifactId>bagri-client-hazelcast</artifactId>
        </dependency>

        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-all</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.xml.xquery</groupId>
            <artifactId>xqj-api</artifactId>
        </dependency>

        <!-- Jetty & Jersey dependencies -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jmx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-jetty-http</artifactId>
        </dependency>
        <dependency>
       	    <groupId>org.glassfish.jersey.media</groupId>
       	    <artifactId>jersey-media-json-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-jaxrs</artifactId>
        </dependency>

        <!-- Dependencies for logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>

        <!--Test dependencies-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
            <artifactId>jersey-test-framework-provider-jetty</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>

        <!--LOCAL REST SERVER RUN PROFILE-->
        <profile>
            <id>test</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <!-- Run REST server mvn -Drun-rest -->
                            <execution>
                                <id>run-rest</id>
                                <phase>test</phase>
                                <configuration>
                                    <tasks if="run-rest">
                                        <java fork="true" classname="com.bagri.rest.BagriRestServer">
                                            <jvmarg line="-server -Xms512m -Xmx1028m" />
                                            <sysproperty key="node.logdir" value="./logs" />
                                            <sysproperty key="node.name" value="rest" />
                                            <sysproperty key="logback.configurationFile" value="hz-logging.xml" />
                                            <sysproperty key="bdb.log.level" value="debug" />
                                            <classpath>
                                                <path refid="maven.compile.classpath" />
                                                <path refid="maven.runtime.classpath" />
                                                <pathelement location="config/" />
                                            </classpath>
                                        </java>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>

