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

    <parent>
        <groupId>tigase</groupId>
        <artifactId>tigase-acs</artifactId>
        <version>3.5.0-SNAPSHOT</version>
    </parent>

    <properties>
        <maven.javadoc.skip>true</maven.javadoc.skip>

        <docu_build_path>${project.build.directory}/documentation</docu_build_path>
        <documentation_phases.all_converters>generate-resources</documentation_phases.all_converters>
    </properties>

    <artifactId>tigase-acs-dist</artifactId>
    <packaging>bundle</packaging>

    <name>Tigase ACS distribution package</name>
    <description>Tigase Advanced Clustering Strategy (distribution package)</description>

    <profiles>

        <profile>
            <id>dist</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>dist</name>
                </property>
            </activation>
            <properties>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <guide_name>Tigase_ACS</guide_name>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>output-html</id>
                                <phase>generate-resources</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>dist</id>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-jar</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>tigase-docs-resource</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <!--
                            If the artifact is also listed as a dependency, the version of the artifactItem
                            will default to the version from the dependencies or dependencyManagement, e.g.
                            -->
                            <!--<includes>**/*.asciidoc,**/*.css,**/*.jpg,**/*.png</includes>-->
                            <includes>documentation/**/*</includes>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>tigase</groupId>
                                    <artifactId>tigase-acs-muc</artifactId>
                                    <outputDirectory>${docu_build_path}/tigase-acs-muc</outputDirectory>
                                    <!--<excludes>tigase/**/*</excludes>-->
                                </artifactItem>

                                <artifactItem>
                                    <groupId>tigase</groupId>
                                    <artifactId>tigase-acs-pubsub</artifactId>
                                    <outputDirectory>${docu_build_path}/tigase-acs-pubsub</outputDirectory>
                                </artifactItem>

                                <artifactItem>
                                    <groupId>tigase</groupId>
                                    <artifactId>tigase-acs-workgroup</artifactId>
                                    <outputDirectory>${docu_build_path}/tigase-acs-workgroup</outputDirectory>
                                </artifactItem>

                                <artifactItem>
                                    <groupId>tigase</groupId>
                                    <artifactId>tigase-acs-mix</artifactId>
                                    <outputDirectory>${docu_build_path}/tigase-acs-mix</outputDirectory>
                                </artifactItem>

                                <artifactItem>
                                    <groupId>tigase</groupId>
                                    <artifactId>tigase-acs-meet</artifactId>
                                    <outputDirectory>${docu_build_path}/tigase-acs-meet</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-sm</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-muc</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-pubsub</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-mix</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-meet</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>tigase</groupId>
            <artifactId>tigase-acs-workgroup</artifactId>
            <scope>runtime</scope>
        </dependency>


    </dependencies>
</project>
