<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2002-2014 "Neo Technology,"
  Network Engine for Objects in Lund AB [http://neotechnology.com]

  This file is part of Neo4j.

  Neo4j is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program. If not, see <http://www.gnu.org/licenses />.
  -->

<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">
  <parent>
    <groupId>org.neo4j</groupId>
    <artifactId>parent</artifactId>
    <version>2.1.1</version>
    <relativePath>../..</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.neo4j.app</groupId>
  <artifactId>neo4j-server-advanced</artifactId>
  <version>2.1.1</version>

  <name>Neo4j Advanced Server</name>
  <description>Standalone Neo4j server application.</description>
  <url>http://components.neo4j.org/${project.artifactId}/${project.version}</url>

  <properties>
    <bundle.namespace>org.neo4j.server.advanced</bundle.namespace>
    <short-name>server-advanced</short-name>
    <version-package>server.advanced</version-package>
    <neo4j-server.mainClass>org.neo4j.server.Bootstrapper</neo4j-server.mainClass>
    <neo-server.home>target/generated-resources/appassembler/jsw</neo-server.home>
    <neo-server.confdir>target/test-classes/etc/neo-server</neo-server.confdir>
    <felix-fileinstall.version>3.0.2</felix-fileinstall.version>
    <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>

    <!-- Run integration tests against a server that is started elsewhere This is used in ServerIntegrationTestFacade, 
      which currently assumes external servers to be running at http://localhost:7474/ -->
    <testWithExternalServer>false</testWithExternalServer>

    <webdriver.version>2.0b1</webdriver.version>
    <webdriver.impl.class>org.openqa.selenium.firefox.FirefoxDriver</webdriver.impl.class>

    <docs.url>http://docs.neo4j.org/chunked/${project.version}/server.html</docs.url>
    <docs-plugin.skip>true</docs-plugin.skip>
  </properties>

  <packaging>jar</packaging>

  <scm>
	  <url>https://github.com/neo4j/neo4j/tree/master/advanced/server-advanced</url>
  </scm>

  <licenses>
    <license>
      <name>GNU Affero General Public License, Version 3</name>
      <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
      <comments>The software ("Software") developed and owned by Network Engine for
        Objects in Lund AB (referred to in this notice as "Neo Technology") is
        licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 to all
        third parties and that license is included below.

        However, if you have executed an End User Software License and Services
        Agreement or an OEM Software License and Support Services Agreement, or
        another commercial license agreement with Neo Technology or one of its
        affiliates (each, a "Commercial Agreement"), the terms of the license in
        such Commercial Agreement will supersede the GNU AFFERO GENERAL PUBLIC
        LICENSE Version 3 and you may use the Software solely pursuant to the
        terms of the relevant Commercial Agreement.
      </comments>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>org.neo4j.app</groupId>
      <artifactId>neo4j-server</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.neo4j.app</groupId>
      <artifactId>neo4j-server</artifactId>
      <type>test-jar</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>neo4j-kernel</artifactId>
      <type>test-jar</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>neo4j-advanced</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.picocontainer</groupId>
      <artifactId>picocontainer</artifactId>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-firefox-driver</artifactId>
      <version>${webdriver.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-htmlunit-driver</artifactId>
      <version>${webdriver.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-chrome-driver</artifactId>
      <version>${webdriver.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-ie-driver</artifactId>
      <version>${webdriver.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>neo4j-shell</artifactId>
      <version>${project.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${project.build.directory}/generated-sources</directory>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>NOTICE.txt</include>
          <include>LICENSE.txt</include>
          <include>CHANGES.txt</include>
          <include>LICENSES.txt</include>
        </includes>
      </resource>
    </resources>


    <plugins>

      <!-- Development execution -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>${neo4j-server.mainClass}</mainClass>
          <systemProperties>
            <systemProperty>
              <key>org.neo4j.server.properties</key>
              <value>${basedir}/neo4j-home/conf/neo4j-server.properties</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>${neo4j-server.mainClass}</mainClass>
                </manifest>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
          </systemPropertyVariables>
          <argLine>-Xmx1024m</argLine>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/functionaltest/java</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-resource</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>add-test-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>src/functionaltest/resources</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins combine.children="append">
            <plugin>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <detectJavaApiLink>true</detectJavaApiLink>
                <detectLinks>true</detectLinks>
                <quiet>true</quiet>
                <excludePackageNames>*.impl.*</excludePackageNames>
              </configuration>
              <reports>
                <report>javadoc</report>
              </reports>
            </plugin>
          </reportPlugins>
        </configuration>
        <executions>
          <execution>
            <id>attach-descriptor</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <id>web-tests</id>
      <activation>
        <property>
          <name>tests</name>
          <value>web</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-test-source</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/webtest/java</source>
                    <!-- Required b/c we use utility classes from here -->
                    <source>src/functionaltest/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/*WebTest.java</include>
              </includes>
            </configuration>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <!-- An execution that adds src/main/resources to the classpath. Allows changing static files and 
        seeing results without restarting server. Done with ant b/c of problems adding local directory to classpath 
        when using exec. -->
      <id>webdev-exec</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>

            <configuration>
              <target>
                <property name="classpath" refid="maven.runtime.classpath" />
                <exec executable="java">
                  <arg line="-Dorg.neo4j.server.properties=${basedir}/neo4j-home/conf/neo4j-server.properties" />
                  <arg line="-classpath" />
                  <arg line="${basedir}/src/main/resources:${classpath}" />
                  <arg line="${neo4j-server.mainClass}" />
                </exec>
              </target>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Firefox is default implementation, set in properties at the top of this file. -->
    <profile>
      <id>htmlunit</id>
      <properties>
        <webdriver.impl.class>org.openqa.selenium.htmlunit.HtmlUnitDriver</webdriver.impl.class>
      </properties>
    </profile>
    <profile>
      <id>chrome</id>
      <properties>
        <webdriver.impl.class>org.openqa.selenium.chrome.ChromeDriver</webdriver.impl.class>
      </properties>
    </profile>
    <profile>
      <id>ie</id>
      <properties>
        <webdriver.impl.class>org.openqa.selenium.ie.InternetExplorerDriver</webdriver.impl.class>
      </properties>
    </profile>

    <profile>
      <id>initial-build</id>
      <repositories>
        <repository>
          <id>neo4j-build</id>
          <name>Neo4j Developer Repository</name>
          <url>http://m2.neo4j.org/content/groups/everything</url>
        </repository>
      </repositories>
    </profile>

  </profiles>

  <repositories>
    <repository>
      <id>selenium-repository</id>
      <url>http://selenium.googlecode.com/svn/repository</url>
    </repository>
    <repository>
      <id>neo4j-release-repository</id>
      <name>Neo4j Maven 2 release repository</name>
      <url>http://m2.neo4j.org/content/repositories/releases</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>neo4j-snapshot-repository</id>
      <name>Neo4j Maven 2 snapshot repository</name>
      <url>http://m2.neo4j.org/content/repositories/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

</project>
