<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>tigase</groupId>
    <artifactId>tigase-projects-parent</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>pom</packaging>

    <name>Tigase Projects master configuration</name>

    <url>http://www.tigase.org/</url>
    <issueManagement>
        <system>Redmine</system>
        <url>https://projects.tigase.org/projects/tigase-server</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://repository.tigase.org/git/tigase-server.git</connection>
        <developerConnection>scm:git:https://repository.tigase.org/git/tigase-server.git</developerConnection>
        <url>https://projects.tigase.org/projects/tigase-server/repository</url>
    </scm>

    <organization>
        <name>"Tigase, Inc."</name>
        <url>http://www.tigase.net</url>
    </organization>

    <developers>
        <developer>
            <id>kobit</id>
            <name>Artur Hefczyc</name>
            <email>kobit@tigase.org</email>
            <url>http://www.tigase.net/</url>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <slf4j.version>1.7.5</slf4j.version>

        <packaging.type>bundle</packaging.type>


        <dist-dir>${project.build.directory}/_dists/</dist-dir>

        <guide_filename>index</guide_filename>
        <guide_name></guide_name>
        <guide_path>${project.build.directory}/_docs/${guide_name}_Guide</guide_path>
        <maven.build.timestamp.format>yyyy-MM-dd/HH:mm:ss</maven.build.timestamp.format>

        <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>
        <sign-skip-server>true</sign-skip-server>
        <verbose-log>false</verbose-log>
        <tsa-uri></tsa-uri>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>



        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <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>
                            <Tigase-Required-Dependencies>tigase.server=${project.dependencies[1].version}</Tigase-Required-Dependencies>
                            <Bundle-Activator>tigase.muc.Activator</Bundle-Activator>
                            <Export-Package>tigase.muc.*</Export-Package>
                        </instructions>
                    </configuration>
                </plugin>                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>


                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                    <executions>
                        <execution>
                            <id>copy-resources</id>
                            <!-- here the phase you need -->
                            <phase>validate</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${basedir}/${guide_path}/html</outputDirectory>
                                <resources>
                                    <resource>

                                        <directory>src/non-packaged-resources</directory>
                                        <filtering>true</filtering>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!--<plugin>-->
                    <!--<groupId>org.asciidoctor</groupId>-->
                    <!--<artifactId>asciidoctor-maven-plugin</artifactId>-->
                    <!--<version>1.5.7.1</version>-->
                    <!--<executions>-->
                        <!--<execution>-->
                            <!--<id>output-html</id>-->
                            <!--<goals>-->
                                <!--<goal>process-asciidoc</goal>-->
                            <!--</goals>-->
                            <!--<phase>generate-resources</phase>-->
                            <!--<configuration>-->
                                <!--<sourceDirectory>./admin</sourceDirectory>-->
                                <!--<backend>html5</backend>-->
                                <!--<outputDirectory>${myproject.basedir}/distribution-docs/Administration_Guide/html-->
                                <!--</outputDirectory>-->
                                <!--<attributes>-->
                                    <!--<toc>left</toc>-->
                                    <!--<sectanchors>true</sectanchors>-->
                                    <!--<linkcss>true</linkcss>-->
                                    <!--<imagesdir>.</imagesdir>-->
                                <!--</attributes>-->
                            <!--</configuration>-->
                        <!--</execution>-->
                        <!--<execution>-->
                            <!--<id>output-html-dev</id>-->
                            <!--<goals>-->
                                <!--<goal>process-asciidoc</goal>-->
                            <!--</goals>-->
                            <!--<phase>generate-resources</phase>-->
                            <!--<configuration>-->
                                <!--<sourceDirectory>./devguide</sourceDirectory>-->
                                <!--<backend>html5</backend>-->
                                <!--<outputDirectory>${myproject.basedir}/distribution-docs/Developer_Guide/html-->
                                <!--</outputDirectory>-->
                            <!--</configuration>-->
                        <!--</execution>-->
                        <!--&lt;!&ndash;<execution>&ndash;&gt;-->
                        <!--&lt;!&ndash;<id>output-docbook</id>&ndash;&gt;-->
                        <!--&lt;!&ndash;<goals>&ndash;&gt;-->
                        <!--&lt;!&ndash;<goal>process-asciidoc</goal>&ndash;&gt;-->
                        <!--&lt;!&ndash;</goals>&ndash;&gt;-->
                        <!--&lt;!&ndash;<configuration>&ndash;&gt;-->
                        <!--&lt;!&ndash;<sourceDirectory>./</sourceDirectory>&ndash;&gt;-->

                        <!--&lt;!&ndash;<preserveDirectories>true</preserveDirectories>&ndash;&gt;-->
                        <!--&lt;!&ndash;<outputDirectory>${project.build.directory}/docbook/</outputDirectory>&ndash;&gt;-->
                        <!--&lt;!&ndash;<backend>docbook</backend>&ndash;&gt;-->
                        <!--&lt;!&ndash;<doctype>book</doctype>&ndash;&gt;-->
                        <!--&lt;!&ndash;<attributes>&ndash;&gt;-->
                        <!--&lt;!&ndash;<linkcss>true</linkcss>&ndash;&gt;-->
                        <!--&lt;!&ndash;<imagesdir>.</imagesdir>&ndash;&gt;-->
                        <!--&lt;!&ndash;</attributes>&ndash;&gt;-->
                        <!--&lt;!&ndash;</configuration>&ndash;&gt;-->
                        <!--&lt;!&ndash;</execution>&ndash;&gt;-->
                    <!--</executions>-->
                    <!--<configuration>-->
                        <!--<sourceHighlighter>coderay</sourceHighlighter>-->
                        <!--<preserveDirectories>true</preserveDirectories>-->
                        <!--<gemPath>gems-provided</gemPath>-->
                        <!--<sourceDocumentName>index.asciidoc</sourceDocumentName>-->
                        <!--<attributes>-->
                            <!--<endpoint-url>http://docs.tigase.org</endpoint-url>-->
                            <!--<toc>left</toc>-->
                            <!--<sectanchors>true</sectanchors>-->
                            <!--<linkcss>true</linkcss>-->
                            <!--<imagesdir>.</imagesdir>-->
                        <!--</attributes>-->
                        <!--<headerFooter>true</headerFooter>-->
                    <!--</configuration>-->
                <!--</plugin>-->








































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

                            <endpoint-url>http://docs.tigase.net</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>











            </plugins>
        </pluginManagement>

        <finalName>${project.artifactId}-${gitVersion}</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.4</version>
                <configuration>
                    <timestampFormat>{0,date} {0,time}</timestampFormat>
                    <shortRevisionLength>8</shortRevisionLength>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>



            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>prod</id>
                        <phase>none</phase>
                    </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-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>1.8</source>
                            <quiet>true</quiet>
                            <aggregate>true</aggregate>

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

                            <finalName>${project.artifactId}-${project.version}-b${gitVersion}</finalName>
                            <jarOutputDirectory>pack</jarOutputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!--<plugin>-->
                <!--<groupId>org.commonjava.maven.plugins</groupId>-->
                <!--<artifactId>directory-maven-plugin</artifactId>-->
                <!--<version>0.1</version>-->
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<id>directories-clean</id>-->
                        <!--<goals>-->
                            <!--<goal>directory-of</goal>-->
                        <!--</goals>-->
                        <!--<phase>pre-clean</phase>-->
                        <!--<configuration>-->
                            <!--<property>myproject.basedir</property>-->
                            <!--<project>-->
                                <!--<groupId>tigase</groupId>-->
                                <!--<artifactId>tigase-server-master</artifactId>-->
                            <!--</project>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                    <!--<execution>-->
                        <!--<id>directories</id>-->
                        <!--<goals>-->
                            <!--<goal>directory-of</goal>-->
                        <!--</goals>-->
                        <!--<phase>validate</phase>-->
                        <!--<configuration>-->
                            <!--<property>myproject.basedir</property>-->
                            <!--<project>-->
                                <!--<groupId>tigase</groupId>-->
                                <!--<artifactId>tigase-server-master</artifactId>-->
                            <!--</project>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                <!--</executions>-->
            <!--</plugin>-->
        </plugins>

        <resources>
            <resource>
                <directory>src/main/database</directory>
                <targetPath>database</targetPath>
                <includes>
                    <include>**/*.sql</include>
                    <include>**/*.sh</include>
                    <include>**/*.cmd</include>
                    <include>**/*.txt</include>
                </includes>
            </resource>

            <resource>
                <directory>src/main/asciidoc</directory>
                <targetPath>documentation</targetPath>
                <includes>
                    <include>**/*.asciidoc</include>
                    <include>**/*.css</include>
                </includes>
            </resource>

        </resources>


    </build>
    <repositories>
        <repository>
            <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>

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