<?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-utils</artifactId>
    <name>Tigase Utils</name>
    <version>4.0.1-SNAPSHOT</version>
    <packaging>bundle</packaging>
    <description>Tigase Utils</description>
    <url>http://www.tigase.org/</url>
    <issueManagement>
        <system>Redmine</system>
        <url>https://projects.tigase.org/projects/tigase-utils</url>
    </issueManagement>
    <developers>
        <developer>
            <name>Artur Hefczyc</name>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>GNU Affero General Public License</name>
            <url>http://www.gnu.org/licenses/agpl.txt</url>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:https://git.tigase.tech/tigase-utils.git</connection>
        <developerConnection>scm:git:https://git.tigase.tech/tigase-utils.git</developerConnection>
        <url>https://tigase.tech/projects/tigase-utils/repository</url>
        <tag>tigase-utils-4.0.0</tag>
    </scm>
    <organization>
        <name>Tigase</name>
        <url>http://www.tigase.org</url>
    </organization>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>1.8</source>
                            <quiet>true</quiet>
                            <aggregate>true</aggregate>
                            <includeDependencySources>false</includeDependencySources>

                            <finalName>${project.artifactId}-${project.version}-b${gitVersion}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.1</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'
                                }
                                log.info("setting revision to: " + version)

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

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

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
                <configuration>
                    <forkMode>always</forkMode>
                    <systemPropertyVariables>
                        <project.target>${project.build.outputDirectory}</project.target>
                        <project.version>${project.version}</project.version>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/annotations/*</include>
                            </includes>
                        </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">
                        <Implementation-Title>${project.name}</Implementation-Title>
                        <Implementation-Version>${project.version}-b${gitVersion}/${buildNumber}
                            (${maven.build.timestamp})
                        </Implementation-Version>
                        <Implementation-Build>${gitVersion}/${buildNumber} (${maven.build.timestamp})
                        </Implementation-Build>
                        <Tigase-Version>${project.version}-b${gitVersion}</Tigase-Version>
                        <Export-Package>
                            gnu.inet.encoding.*;version=${project.version},tigase.annotations.*;version=${project.version},tigase.cert.*;version=${project.version},tigase.collections.*;version=${project.version},tigase.criteria.*;version=${project.version},tigase.form.*;version=${project.version},tigase.util.*;version=${project.version},tigase.xmpp.jid.*;version=${project.version},tigase.xmpp.rsm.*;version=${project.version}
                        </Export-Package>
                        <Import-Package>!junit.*,!sun.*,!com.sun.*,*</Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Embed-Dependency>*;scope=compile|runtime;artifactId=!junit|org.osgi.core|slf4j-api
                        </Embed-Dependency>
                        <Bundle-SymbolicName>${project.artifactId};singleton=true</Bundle-SymbolicName>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-xmltools</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <snapshots />
            <id>tigase</id>
            <name>Tigase repository</name>
            <url>https://maven-repo.tigase.net/repository/release</url>
        </repository>
        <repository>
            <id>tigase-snapshot</id>
            <name>Tigase repository</name>
            <url>https://maven-repo.tigase.net/repository/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <distributionManagement>
        <repository>
            <id>tigase</id>
            <name>Tigase repository</name>
            <url>https://maven-repo.tigase.net/repository/release</url>
        </repository>
        <snapshotRepository>
            <id>tigase-snapshot</id>
            <name>Tigase snapshot repository</name>
            <url>https://maven-repo.tigase.net/repository/snapshot</url>
        </snapshotRepository>
    </distributionManagement>
</project>
