<?xml version="1.0" encoding="UTF-8"?>

<!-- ~ /* ~ * Copyright 2014 Orient Technologies LTD (info(at)orientechnologies.com) 
    ~ * ~ * Licensed under the Apache License, Version 2.0 (the "License"); ~ 
    * you may not use this file except in compliance with the License. ~ * You 
    may obtain a copy of the License at ~ * ~ * http://www.apache.org/licenses/LICENSE-2.0 
    ~ * ~ * Unless required by applicable law or agreed to in writing, software 
    ~ * distributed under the License is distributed on an "AS IS" BASIS, ~ * 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    ~ * See the License for the specific language governing permissions and ~ 
    * limitations under the License. ~ * ~ * For more information: http://www.orientechnologies.com 
    ~ */ -->

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

    <parent>
        <groupId>com.orientechnologies</groupId>
        <artifactId>orientdb-parent</artifactId>
        <version>2.2.31</version>
    </parent>

    <artifactId>orientdb-server</artifactId>

    <name>OrientDB Server</name>

    <properties>
        <javac.src.version>1.6</javac.src.version>
        <javac.target.version>1.6</javac.target.version>
        <jar.manifest.mainclass>com.orientechnologies.orient.server.OServerMain</jar.manifest.mainclass>
        <osgi.import>
            javax.mail.*;resolution:=optional,
            orient.client.*;resolution:=optional,
            *
        </osgi.import>
        <osgi.export>com.orientechnologies.orient.server.*</osgi.export>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <argLine>-ea
            -Xmx${heapSize}
            -Xms${heapSize}
            -Dstorage.diskCache.bufferSize=4096
            -XX:MaxDirectMemorySize=512g
            -Dsecurity.userPasswordSaltIterations=10
            -Dmemory.directMemory.trackMode=true
            -Djava.util.logging.manager=com.orientechnologies.common.log.OLogManager$ShutdownLogManager
            -Dstorage.diskCache.checksumMode=storeAndThrow
        </argLine>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-test-commons</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-client</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-tools</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-core</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.2.3</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>fluent-hc</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>development</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <exclude.test.1>**/AutomaticBackupTest.java</exclude.test.1>
            </properties>
        </profile>

        <profile>
            <id>ci</id>
            <activation>
                <property>
                    <name>orientdb.test.env</name>
                    <value>ci</value>
                </property>
            </activation>
            <properties>
                <exclude.test.1>empty.java</exclude.test.1>
            </properties>

        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>orientdb.test.env</name>
                    <value>release</value>
                </property>
            </activation>
            <properties>
                <exclude.test.1>empty.java</exclude.test.1>
            </properties>

        </profile>
        <profile>
            <id>localDeploy</id>
            <activation>
                <property>
                    <name>localDeploy</name>
                </property>
            </activation>
        </profile>
    </profiles>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${surefire.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <systemPropertyVariables>
                        <buildDirectory>${project.build.directory}</buildDirectory>
                        <orient.server.testMode>${orient.server.testMode}</orient.server.testMode>
                        <orient.server.port>${orient.server.port}</orient.server.port>
                    </systemPropertyVariables>
                    <excludes>
                        <exclude>${exclude.test.1}</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${surefire.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <systemPropertyVariables>
                        <buildDirectory>${project.build.directory}</buildDirectory>
                        <orient.server.testMode>${orient.server.testMode}</orient.server.testMode>
                        <orient.server.port>${orient.server.port}</orient.server.port>
                    </systemPropertyVariables>
                    <excludes>
                        <exclude>**/*CrashRestoreIT.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>${jar.manifest.mainclass}</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>
