<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>tigase.jaxmpp.bot</groupId>
    <artifactId>parent</artifactId>
    <packaging>pom</packaging>
    <name>Tigase XMPP Bot Framework</name>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <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>
        <verbose-log>false</verbose-log>
        <tsa>${tsa-uri}</tsa>
    </properties>

    <licenses>
        <license>
            <name>GNU Affero General Public License</name>
            <url>http://www.gnu.org/licenses/agpl.txt</url>
        </license>
    </licenses>

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

    <modules>
        <module>library</module>
        <module>runtime</module>
        <module>iot</module>
        <module>documentation</module>
    </modules>

    <scm>
        <developerConnection>scm:git:https://repository.tigase.org/git/jaxmpp2.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <build>
        <plugins>
            <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.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</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-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>attach-test-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <!--                            <goal>aggregate</goal>-->
                            <goal>aggregate-jar</goal>
                        </goals>
                        <configuration>
                            <source>1.8</source>
                            <quiet>true</quiet>
                            <aggregate>true</aggregate>
                            <reportOutputDirectory>docs/javadoc</reportOutputDirectory>
                            <destDir>docs/javadoc</destDir>
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <finalName>${project.artifactId}-${project.version}-b${gitVersion}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </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>
    </build>

    <dependencies>
    </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>

</project>
