<?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>
		<!--<packet.version>5.2.0</packet.version>-->
		<dir>target</dir>
		<maven.build.timestamp.format>yyyy-MM-dd/HH:mm:ss</maven.build.timestamp.format>
		<gmavenProviderSelection>2.0</gmavenProviderSelection>
		<groovyVersion>2.1.0</groovyVersion>
	</properties>

	<modelVersion>4.0.0</modelVersion>
	<packaging>bundle</packaging>

	<groupId>tigase</groupId>
	<artifactId>tigase-http-api</artifactId>
	<version>1.0.1-SNAPSHOT</version>
	<name>Tigase HTTP API component</name>
	<description>Tigase HTTP API component</description>

	<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-http-api.git</connection>
		<developerConnection>scm:git:https://repository.tigase.org/git/tigase-http-api.git</developerConnection>
		<url>https://projects.tigase.org/projects/tigase-http-api/repository</url>
	</scm>

	<organization>
		<name>Tigase</name>
		<url>http://www.tigase.org</url>
	</organization>

	<build>
		<finalName>${project.artifactId}</finalName>

		<plugins>
			<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>
				</configuration>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<!-- 2.8.0-01 and later require maven-compiler-plugin 3.0 or higher -->
				<version>3.1</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
					<source>1.6</source>
					<target>1.6</target>
					<encoding>UTF-8</encoding>
					<showDeprecation>true</showDeprecation>
					<!--<verbose>true</verbose>-->
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-compiler</artifactId>
						<version>2.8.0-01</version>
						<!--<extensions>true</extensions>-->
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-batch</artifactId>
						<version>2.1.1-01</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/groovy</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/test/groovy</source>
							</sources>
						</configuration>
					</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>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}: ${project.description}</Implementation-Title>
						<Implementation-Version>${project.version}-b${gitVersion}/${buildNumber}</Implementation-Version>
						<Implementation-Build>${gitVersion}/${buildNumber} (${maven.build.timestamp})</Implementation-Build>
						<Tigase-Version>${project.version}-b${gitVersion}</Tigase-Version>
						<Bundle-Activator>tigase.http.Activator</Bundle-Activator>
						<DynamicImport-Package>'*'</DynamicImport-Package>
						<Import-Package>!junit.*,!sun.*,!com.sun.*,*</Import-Package>
					</instructions>
				</configuration>
			</plugin>

		</plugins>

		<resources>
			<resource>
				<directory>src/scripts/groovy/tigase/</directory>
				<targetPath>scripts</targetPath>
				<includes>
					<include>**/*.groovy</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources/</directory>
				<targetPath>etc</targetPath>
				<includes>
					<include>**/*.xml</include>
				</includes>
			</resource>
		</resources>


		<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>org.apache.felix</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>1.4.0</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>8.1.9.v20130131</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>${groovyVersion}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-server</artifactId>
			<version>5.3.0-SNAPSHOT</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>8.1.9.v20130131</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>

	<reporting>
		<plugins>
		</plugins>
	</reporting>

	<dependencyManagement>
		<dependencies>
		</dependencies>
	</dependencyManagement>  
</project>

