<?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.4.3</groovyVersion>

		<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>
		<verbose-log>false</verbose-log>
		<tsa>${tsa-uri}</tsa>
	</properties>

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

	<groupId>tigase</groupId>
	<artifactId>tigase-http-api-jetty</artifactId>
	<version>1.2.0-SNAPSHOT</version>
	<name>Tigase HTTP API - support for Jetty HTTP Server</name>
	<description>Tigase HTTP API - support for Jetty HTTP Server</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-jetty.git</connection>
		<developerConnection>scm:git:https://repository.tigase.org/git/tigase-http-api-jetty.git</developerConnection>
		<url>https://projects.tigase.org/projects/tigase-http-api-jetty/repository</url>
	  <tag>HEAD</tag>
  </scm>

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

    <profiles>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>
    </profiles>	
	<build>
		<finalName>${project.artifactId}</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.3</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.2</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
					<source>1.8</source>
					<target>1.8</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.9.1-01</version>
						<!--<extensions>true</extensions>-->
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-batch</artifactId>
						<version>2.3.7-01</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.9.1</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.5.3</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>
						<Tigase-Required-Dependencies>tigase.http=${project.dependencies[3].version}</Tigase-Required-Dependencies>
						<Bundle-Activator>tigase.http.Activator</Bundle-Activator>
						<DynamicImport-Package>'*'</DynamicImport-Package>
						<Import-Package>!junit.*,!sun.*,!com.sun.*,*</Import-Package>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jarsigner-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<id>sign</id>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<archiveDirectory>${project.basedir}</archiveDirectory>
					<includes>
						<include>target/tigase*.?ar</include>
						<include>jars/tigase*.?ar</include>
					</includes>
					<processMainArtifact>false</processMainArtifact>
					<processAttachedArtifacts>false</processAttachedArtifacts>
					<tsa>${tsa-uri}</tsa>
					<skip>${sign-skip}</skip>

					<keystore>${sign-keystore}</keystore>
					<alias>${sign-alias}</alias>
					<storepass>${sign-storepass}</storepass>
					<keypass>${sign-keypass}</keypass>
					<verbose>${verbose-log}</verbose>
				</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>
	</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>9.3.9.v20160517</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>${groovyVersion}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-http-api</artifactId>
			<version>1.3.0-SNAPSHOT</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>9.3.9.v20160517</version>
			<scope>compile</scope>
		</dependency>
	</dependencies>

	<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>
	<reporting>
		<plugins>
		</plugins>
	</reporting>

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

