<?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/maven-v4_0_0.xsd">
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <slf4j.version>1.7.5</slf4j.version>
    <packaging.type>bundle</packaging.type>
    <dist-dir>${myproject.basedir}/distribution-packages/</dist-dir>
    <maven.build.timestamp.format>yyyy-MM-dd/HH:mm:ss</maven.build.timestamp.format>
    <maven.javadoc.skip>true</maven.javadoc.skip>

    <sign-keystore>/path/to/jks.keystore</sign-keystore>
    <sign-alias>alias</sign-alias>
    <sign-storepass>storepass</sign-storepass>
    <sign-keypass>keypass</sign-keypass>
    <sign-skip>true</sign-skip>
    <sign-skip-server>true</sign-skip-server>
    <verbose-log>false</verbose-log>
    <tsa-uri></tsa-uri>
  </properties>

  <modelVersion>4.0.0</modelVersion>

  <groupId>tigase</groupId>
  <artifactId>tigase-server-master</artifactId>
  <version>8.0.0-SNAPSHOT</version>

  <name>Tigase XMPP Server Master project</name>

  <packaging>pom</packaging>

  <url>http://www.tigase.org/</url>
  <issueManagement>
    <system>Redmine</system>
    <url>https://projects.tigase.org/projects/tigase-server</url>
  </issueManagement>

  <developers>
    <developer>
      <id>kobit</id>
      <name>Artur Hefczyc</name>
      <email>kobit@tigase.org</email>
      <url>http://www.tigase.org/</url>
      <roles>
	<role>architect</role>
	<role>developer</role>
      </roles>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>GNU Affero General Public License GPLv3</name>
      <url>http://www.gnu.org/licenses/agpl.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://repository.tigase.org/git/tigase-server.git</connection>
    <developerConnection>scm:git:https://repository.tigase.org/git/tigase-server.git</developerConnection>
    <url>https://projects.tigase.org/projects/tigase-server/repository</url>
  </scm>

  <organization>
    <name>"Tigase, Inc."</name>
    <url>http://www.tigase.net</url>
  </organization>

  <modules>
    <module>server</module>
  </modules>

  <profiles>
    <profile>
      <id>doc</id>
      <activation>
	<property>
	  <name>doc</name>
	</property>
      </activation>
      <modules>
	<module>documentation</module>
      </modules>
      <properties>
	<maven.javadoc.skip>false</maven.javadoc.skip>
	<packaging.type>bundle</packaging.type>
      </properties>
    </profile>
    <profile>
      <id>dist</id>
      <activation>
	<property>
	  <name>dist</name>
	</property>
      </activation>
      <modules>
	<module>distribution</module>
      </modules>
      <properties>
	<packaging.type>bundle</packaging.type>
      </properties>
    </profile>
    <profile>
      <id>benchmark</id>
      <activation>
	<property>
	  <name>benchmark-tests</name>
	</property>
      </activation>
      <modules>
	<module>benchmark-tests</module>
      </modules>
      <properties>
	<packaging.type>bundle</packaging.type>
      </properties>
    </profile>
  </profiles>

  <build>

    <finalName>${project.artifactId}-${gitVersion}</finalName>

    <plugins>
      <plugin>
	<artifactId>maven-release-plugin</artifactId>
	<version>2.5.1</version>
      </plugin>
      <plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>buildnumber-maven-plugin</artifactId>
	<version>1.2</version>
	<configuration>
	  <timestampFormat>{0,date} {0,time}</timestampFormat>
	  <doCheck>false</doCheck>
	  <doUpdate>false</doUpdate>
	  <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
	  <shortRevisionLength>8</shortRevisionLength>
	  <autoVersionSubmodules>true</autoVersionSubmodules>
	</configuration>
	<executions>
	  <execution>
	    <phase>validate</phase>
	    <goals>
	      <goal>create</goal>
	    </goals>
	  </execution>
	</executions>
      </plugin>

      <plugin>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.5.1</version>
	<configuration>
	  <source>1.8</source>
	  <target>1.8</target>
	  <encoding>UTF-8</encoding>
	  <showDeprecation>true</showDeprecation>
	</configuration>
      </plugin>

      <plugin>
	<artifactId>maven-assembly-plugin</artifactId>
	<version>2.3</version>
	<executions>
	  <execution>
	    <id>prod</id>
	    <phase>none</phase>
	  </execution>
	</executions>
      </plugin>

      <plugin>
	<groupId>org.codehaus.gmaven</groupId>
	<artifactId>gmaven-plugin</artifactId>
	<version>1.5</version>
	<executions>
	  <execution>
	    <id>gitver</id>
	    <phase>validate</phase>
	    <goals>
	      <goal>execute</goal>
	    </goals>
	    <configuration>
	      <providerSelection>2.0</providerSelection>
	      <properties>
		<script>git rev-list HEAD --count</script>
	      </properties>
	      <source>
		def version
		try {
		def command = project.properties.script
		def process = command.execute()
		process.waitFor()
		
		version = process.in.text.trim()
		} catch (Exception e) {
		version = '0'
		}
		log.info("setting revision to: " + version)
		
		project.properties.setProperty( 'gitVersion' , version )
		
	      </source>
	    </configuration>
	  </execution>
	</executions>
      </plugin>
      
      <plugin>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
        <version>0.1</version>
          <executions>
              <execution>
                  <id>directories-clean</id>
                  <goals>
                      <goal>directory-of</goal>
                  </goals>
                  <phase>pre-clean</phase>
                  <configuration>
                      <property>myproject.basedir</property>
                      <project>
                          <groupId>tigase</groupId>
                          <artifactId>tigase-server-master</artifactId>
                      </project>
                  </configuration>
              </execution>
              <execution>
                  <id>directories</id>
                  <goals>
                      <goal>directory-of</goal>
                  </goals>
                  <phase>validate</phase>
                  <configuration>
                      <property>myproject.basedir</property>
                      <project>
                          <groupId>tigase</groupId>
                          <artifactId>tigase-server-master</artifactId>
                      </project>
                  </configuration>
              </execution>
          </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>tigase</id>
      <name>Tigase repository</name>
      <url>http://maven-repo.tigase.org/repository/release</url>
    </repository>
    <repository>
      <id>tigase-snapshot</id>
      <name>Tigase repository</name>
      <url>http://maven-repo.tigase.org/repository/snapshot</url>
      <snapshots>
	<enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <distributionManagement>
    <repository>
      <id>tigase</id>
      <name>Tigase repository</name>
      <url>http://maven-repo.tigase.org/repository/release</url>
    </repository>
    <snapshotRepository>
      <id>tigase-snapshot</id>
      <name>Tigase snapshot repository</name>
      <url>http://maven-repo.tigase.org/repository/snapshot</url>
    </snapshotRepository>
  </distributionManagement>
</project>

