<?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>
		<maven.build.timestamp.format>yyyy-MM-dd/HH:mm:ss</maven.build.timestamp.format>
	</properties>
	<modelVersion>4.0.0</modelVersion>
	<groupId>tigase</groupId>
	<artifactId>tigase-acs</artifactId>
	<name>Tigase ACS</name>
	<version>2.2.0</version>
	<packaging>bundle</packaging>
	<description>Tigase Advanced Clustering Strategy</description>
	<url>https://projects.tigase.org/projects/goldentabby</url>
	<issueManagement>
		<system>Redmine</system>
		<url>https://projects.tigase.org/projects/goldentabby</url>
	</issueManagement>
	<developers>
		<developer>
			<name>Artur Hefczyc</name>
			<roles>
				<role>architect</role>
				<role>developer</role>
			</roles>
		</developer>
	</developers>
	<licenses>
		<license>
			<name>Tigase ACS</name>
			<url>https://projects.tigase.org/projects/goldentabby/repository/revisions/master/entry/COPYING</url>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:https://repository.tigase.org/git/goldentabby.git</connection>
		<developerConnection>scm:git:https://repository.tigase.org/git/goldentabby.git</developerConnection>
		<url>https://projects.tigase.org/projects/goldentabby/repository</url>
	  <tag>tigase-acs-2.2.0</tag>
  </scm>
	<organization>
		<name>Tigase</name>
		<url>http://www.tigase.com</url>
	</organization>

	<profiles>
		<profile>
			<id>dist</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<property>
					<name>dist</name>
				</property>
			</activation>
			<properties>
				<maven.javadoc.skip>false</maven.javadoc.skip>
				<dist_path>.</dist_path>
				<guide_name>Tigase_ACS</guide_name>
				<guide_path>${dist_path}/docs/${guide_name}_Guide</guide_path>
				<guide_filename>index</guide_filename>
			</properties>



			<build>
				<plugins>
					<plugin>
						<artifactId>maven-release-plugin</artifactId>
						<version>2.5.1</version>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<version>1.5.0</version>
						<executions>
							<execution>
								<id>output-html</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
								<configuration>
									<sourceHighlighter>coderay</sourceHighlighter>
									<backend>html5</backend>
									<preserveDirectories>true</preserveDirectories>
									<outputDirectory>${guide_path}/html</outputDirectory>
									<attributes>
										<toc>left</toc>
										<sectanchors>true</sectanchors>
										<linkcss>true</linkcss>
										<imagesdir>.</imagesdir>
									</attributes>
								</configuration>
							</execution>
							<execution>
								<id>output-docbook</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
								<configuration>
									<preserveDirectories>true</preserveDirectories>
									<outputDirectory>${project.build.directory}/docbook/</outputDirectory>
									<backend>docbook</backend>
									<doctype>book</doctype>
									<attributes>
										<linkcss>true</linkcss>
										<imagesdir>.</imagesdir>
									</attributes>
								</configuration>
							</execution>
						</executions>
						<configuration>
							<gemPath>${project.build.directory}/gems-provided</gemPath>
							<sourceDirectory>./src/main/asciidoc</sourceDirectory>
							<sourceDocumentName>${guide_filename}.asciidoc</sourceDocumentName>
							<attributes>
								<endpoint-url>http://docs.tigase.org</endpoint-url>
							</attributes>
							<headerFooter>true</headerFooter>
						</configuration>
					</plugin>

					<plugin>
						<groupId>com.agilejava.docbkx</groupId>
						<artifactId>docbkx-maven-plugin</artifactId>
						<version>2.0.16</version>
						<dependencies>
							<dependency>
								<groupId>net.sf.docbook</groupId>
								<artifactId>docbook-xml</artifactId>
								<version>5.0-all</version>
								<classifier>resources</classifier>
								<type>zip</type>
								<scope>runtime</scope>
							</dependency>
							<dependency>
								<groupId>net.sf.xslthl</groupId>
								<artifactId>xslthl</artifactId>
								<version>2.0.1</version>
								<scope>runtime</scope>
							</dependency>
							<dependency>
								<groupId>net.sf.offo</groupId>
								<artifactId>fop-hyph</artifactId>
								<version>1.2</version>
								<scope>runtime</scope>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>generate-webhelp</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>generate-webhelp</goal>
								</goals>
								<configuration>
									<targetDirectory>${guide_path}/webhelp/</targetDirectory>
									<!--<imgSrcPath></imgSrcPath>-->
									<ignoreImageScaling>true</ignoreImageScaling>
									<postProcess>
										<copy todir="${guide_path}/webhelp/css">
											<fileset dir="src/main/asciidoc/css" />
										</copy>
										<copy todir="${guide_path}/webhelp/images">
											<fileset dir="src/main/asciidoc/images" />
										</copy>
									</postProcess>

								</configuration>
							</execution>
							<execution>
								<id>generate-pdf</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>generate-pdf</goal>
								</goals>
								<configuration>
									<targetDirectory>${guide_path}/pdf/</targetDirectory>
									<imgSrcPath>${project.build.directory}/docbook/</imgSrcPath>
									<ignoreImageScaling>true</ignoreImageScaling>
									<fopLogLevel>OFF</fopLogLevel>
									<!--<defaultImageWidth>3cm</defaultImageWidth>-->
									<!--<ignoreImageScaling>true</ignoreImageScaling>-->
									<postProcess>
										<move file="${guide_path}/pdf/index.pdf" tofile="${guide_path}/pdf/${guide_name}_Guide.pdf" failonerror="false" />
									</postProcess>
								</configuration>
							</execution>
							<execution>
								<id>generate-html</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>generate-html</goal>
								</goals>
								<configuration>
									<chunkedOutput>true</chunkedOutput>
									<targetDirectory>${guide_path}/html_chunk/</targetDirectory>
									<targetsFilename>true</targetsFilename>
									<useIdAsFilename>true</useIdAsFilename>
									<cssDecoration>true</cssDecoration>
									<annotationCss>true</annotationCss>
									<htmlStylesheet>css/docbook-xsl.css</htmlStylesheet>
									<postProcess>
										<copy todir="${guide_path}/html_chunk/css">
											<fileset dir="src/main/asciidoc/css" />
										</copy>
										<copy todir="${guide_path}/html_chunk/images">
											<fileset dir="src/main/asciidoc/images" />
										</copy>
									</postProcess>
								</configuration>
							</execution>
						</executions>
						<configuration>
							<chunkedOutput>true</chunkedOutput>
							<sourceDirectory>${project.build.directory}/docbook/</sourceDirectory>
							<includes>${guide_filename}.xml</includes>
							<!--<imgSrcPath></imgSrcPath>-->
							<highlightSource>1</highlightSource>
							<!--<foCustomization>src/docbkx/docbook-fo.xsl</foCustomization>-->
							<hyphenate>true</hyphenate>
							<hyphenateVerbatim>true</hyphenateVerbatim>
						</configuration>
					</plugin>

					<plugin>
						<artifactId>maven-clean-plugin</artifactId>
						<version>2.6</version>
						<executions>
							<execution>
								<id>Remove *.fo file</id>
								<phase>package</phase>
								<goals>
									<goal>clean</goal>
								</goals>
								<configuration>
									<filesets>
										<fileset>
											<directory>${guide_path}/pdf/</directory>
											<followSymlinks>false</followSymlinks>
											<includes>
												<include>*.fo</include>
											</includes>
										</fileset>
									</filesets>
									<excludeDefaultDirectories>true</excludeDefaultDirectories>
								</configuration>
							</execution>
							<execution>
								<id>Remove docs</id>
								<phase>clean</phase>
								<goals>
									<goal>clean</goal>
								</goals>
								<configuration>
									<filesets>
										<fileset>
											<directory>${guide_path}</directory>
											<followSymlinks>false</followSymlinks>
											<includes>
												<include>**/*</include>
											</includes>
										</fileset>
									</filesets>
									<excludeDefaultDirectories>true</excludeDefaultDirectories>
									<!--<verbose>true</verbose>-->
								</configuration>
							</execution>
						</executions>
					</plugin>



				</plugins>
			</build>
			<pluginRepositories>
				<pluginRepository>
					<id>sonatype.snapshots</id>
					<name>Maven Plugin Snapshots</name>
					<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
					<releases>
						<enabled>false</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>



		</profile>
	</profiles>

	<build>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>dist</directory>
							<includes>
								<include>**/*.jar</include>
								<include>**/*.gz</include>
								<include>**/*.zip</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
				</configuration>
			</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>
					<shortRevisionLength>8</shortRevisionLength>
				</configuration>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</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'
								}
								println "setting revision to: " + version

								project.properties.setProperty( 'gitVersion' , version )

							</source>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>com.github.wvengen</groupId>
				<artifactId>proguard-maven-plugin</artifactId>
				<version>2.0.8</version>
				<dependencies>
					<dependency>
						<groupId>net.sf.proguard</groupId>
						<artifactId>proguard-base</artifactId>
						<version>5.1</version>
						<scope>runtime</scope>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>Proguard ACS</id>
						<phase>package</phase>
						<goals>
							<goal>proguard</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<options>
						<!--<option>-printseeds</option>-->
						<!--<option>-verbose</option>-->

						<option>-allowaccessmodification</option>

						<option>-dontwarn</option>
						<option>-dontshrink</option>
						<option>-dontoptimize</option>

						<option>-renamesourcefileattribute SourceFile</option>

						<option>-keeppackagenames</option>
						<option>-keepparameternames</option>

						<option>-keep public class * {public protected *;}</option>

						<option>-keepattributes Exceptions,InnerClasses,Signature,
							Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod</option>
					</options>
					<libs>
						<lib>${java.home}/lib/rt.jar</lib>
						<lib>${java.home}/lib/jce.jar</lib>
					</libs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<version>2.5.1</version>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>

				<executions>
					<execution>
						<id>dist</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<source>1.7</source>
							<aggregate>true</aggregate>
							<quiet>true</quiet>

							<reportOutputDirectory>${project.reporting.outputDirectory}/docs/javadoc</reportOutputDirectory>
							<destDir>docs/javadoc</destDir>

							<finalName>${project.artifactId}-${project.version}-b${gitVersion}</finalName>
							<jarOutputDirectory>dist</jarOutputDirectory>

						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<id>dist</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>src/main/assembly/dist.xml</descriptor>
							</descriptors>
							<tarLongFileMode>gnu</tarLongFileMode>
							<finalName>${project.artifactId}-${project.version}-b${gitVersion}</finalName>
							<outputDirectory>dist</outputDirectory>
							<appendAssemblyId>false</appendAssemblyId>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>2.4.0</version>
				<extensions>true</extensions>
				<configuration>
					<instructions combine.inherited="append">
						<manifestLocation>src/main/resources/META-INF/MANIFEST.MF</manifestLocation>
						<Implementation-Title>${project.name}</Implementation-Title>
						<Implementation-Version>${project.version}-b${gitVersion}/${buildNumber}</Implementation-Version>
						<Implementation-Build>${gitVersion}/${buildNumber} (${maven.build.timestamp})</Implementation-Build>
						<Bundle-Activator>tigase.acs.Activator</Bundle-Activator>
						<Export-Package>tigase.acs</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh-external</artifactId>
				<version>2.2</version>
			</extension>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh</artifactId>
				<version>2.2</version>
			</extension>
		</extensions>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-server</artifactId>
			<version>7.0.0</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.felix</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>1.4.0</version>
			<scope>provided</scope>
			<type>bundle</type>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-acs-muc</artifactId>
			<version>1.1.0</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-acs-pubsub</artifactId>
			<version>1.1.0</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>licence-lib</artifactId>
			<version>1.1.0</version>
			<scope>compile</scope>
		</dependency>
	</dependencies>
	<repositories>
		<repository>
			<id>tigase</id>
			<name>Tigase repository</name>
			<url>http://maven.tigase.org</url>
		</repository>
		<repository>
			<id>tigase-snapshot</id>
			<name>Tigase repository</name>
			<url>http://build.xmpp-test.net/maven/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>
	<distributionManagement>
		<repository>
			<id>tigase</id>
			<name>Tigase repository</name>
			<url>scp://maven.tigase.org:/home/webapp/maven-repository</url>
		</repository>
		<snapshotRepository>
			<id>tigase-snapshot</id>
			<name>Tigase snapshot repository</name>
			<url>scp://build.xmpp-test.net:/home/maven/repository</url>
		</snapshotRepository>
	</distributionManagement>
</project>
