<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>

  <!--
    We use SonaType for publishing artefacts. Parent POM makes things easier here.
  -->
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>5</version>
  </parent>

  <!-- Project info. -->
  <groupId>com.carrotsearch</groupId>
  <artifactId>jsuffixarrays</artifactId>
  <version>0.1.0</version>
  <packaging>jar</packaging>

  <name>JSuffixArrays</name>
  <description>A number of algorithms constructing suffix arrays in Java.</description>
  <url>http://labs.carrotsearch.com/jsuffixarrays.html</url>


  <!-- Extended project info. -->
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>Carrot Search s.c.</name>
    <url>http://www.carrotsearch.com</url>
  </organization>

  <issueManagement>
    <system>Jira</system>
    <url>http://issues.carrot2.org/browse/JSA</url>
  </issueManagement>

  <mailingLists>
    <mailingList>
      <name>Announcements and bug reports mailing list</name>
      <subscribe>jsuffixarrays+subscribe@googlegroups.com</subscribe>
      <unsubscribe>jsuffixarrays+unsubscribe@googlegroups.com</unsubscribe>
      <post>jsuffixarrays@googlegroups.com</post>
    </mailingList>
  </mailingLists>

  <scm>
    <url>git@github.com:carrotsearch/jsuffixarrays.git</url>
    <connection>scm:git:git@github.com:carrotsearch/jsuffixarrays.git</connection>
    <developerConnection>scm:git:git@github.com:carrotsearch/jsuffixarrays.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <id>dawid.weiss</id>
      <name>Dawid Weiss</name>
      <email>dawid.weiss@carrotsearch.com</email>
    </developer>

    <developer>
      <id>stanislaw.osinski</id>
      <name>Stanisław Osiński</name>
      <email>stanislaw.osinski@carrotsearch.com</email>
    </developer>
    
    <developer>
      <id>michal.nowak</id>
      <name>Michał Nowak</name>
    </developer>
  </developers>

  <!-- Global properties. -->
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
  </properties>


  <!-- Dependencies. -->
  <dependencies>
    <dependency>
    	<groupId>com.google.guava</groupId>
    	<artifactId>guava</artifactId>
    	<version>r08</version>
    	<type>jar</type>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>commons-io</groupId>
    	<artifactId>commons-io</artifactId>
    	<version>2.0.1</version>
    	<type>jar</type>
    	<scope>test</scope>
    </dependency>
    <dependency>
    	<groupId>com.carrotsearch</groupId>
    	<artifactId>hppc</artifactId>
    	<version>0.3.3</version>
    	<type>jar</type>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.testng</groupId>
    	<artifactId>testng</artifactId>
    	<version>5.14.9</version>
    	<type>jar</type>
    	<scope>test</scope>
    </dependency>
  </dependencies>


  <!-- Build tuning. -->
  <build>
    <defaultGoal>install</defaultGoal>

    <pluginManagement>
      <plugins>      
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.6.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.2</version>
        </plugin>

        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.1</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <buildOutputDirectory>${project.build.directory}/eclipse</buildOutputDirectory>
        </configuration>
      </plugin>
    
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <useReleaseProfile>true</useReleaseProfile>
          <releaseProfiles>release,maven-release</releaseProfiles>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.7.2</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>      
    </plugins>
  </build>


  <!-- Reports -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <targetJdk>${maven.compiler.target}</targetJdk>
          <aggregate>true</aggregate>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.7.2</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.2</version>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <findbugsXmlOutput>true</findbugsXmlOutput>
        </configuration>
      </plugin>
    </plugins>
  </reporting>


  <profiles>
    <!-- No tests, no additional checks. -->
    <profile>
      <id>fastinstall</id>
      <properties>
        <maven.test.skip>true</maven.test.skip>
      </properties>
      <build>
        <defaultGoal>install</defaultGoal>
      </build>
    </profile>


    <!-- Execute clover code coverage reports via ANT. -->
    <profile>
      <id>clover</id>

      <build>
        <plugins>
          <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-clover2-plugin</artifactId>
            <configuration>
              <includesTestSourceRoots>false</includesTestSourceRoots>
            </configuration>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <goals>
                  <goal>instrument</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

      <reporting>
        <plugins>
          <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-clover2-plugin</artifactId>
            <version>3.0.2</version>
            <configuration>
              <generateXml>true</generateXml>
              <generateHtml>true</generateHtml>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>


    <!-- Release mode. -->
    <profile>
      <id>release</id>

      <build>
        <defaultGoal>package</defaultGoal>

        <plugins>
          <!-- Attach and modify JavaDocs. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
              <stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
              <docfilessubdirs>true</docfilessubdirs>
              <windowtitle>${project.name} v${version} API Documentation (JavaDoc)</windowtitle>
              <doctitle>${project.name} v${version} API Documentation</doctitle>
              <header><![CDATA[<div id='header'><a class='logo' target='_top' href='http://labs.carrotsearch.com'><img src='resources/logo.png'></a>${project.name} v${version} <br>API Documentation</div>]]></header>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Attach sources -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!--
            Configure assembly of ZIP and TAR.GZ bundles (stand-alone
            distributions).
          -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/bin.xml</descriptor>
              </descriptors>
              <attach>false</attach>
              <appendAssemblyId>false</appendAssemblyId>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
            <executions>
              <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      Sonatype manual release mode. Prepare bundle ZIPs, sign everything
      once completed and prepare the release bundle JAR.
    -->
    <profile>
      <id>sonatype</id>
      <build>
        <defaultGoal>verify</defaultGoal>

        <plugins>
          <!-- GPG sign artefacts. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.1</version>
            <configuration>
              <excludes>
                <exclude>**/*.gz</exclude>
                <exclude>**/*.zip</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
