<?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>

    <parent>
        <groupId>org.kaazing</groupId>
        <artifactId>gateway</artifactId>
        <version>5.6.2</version>
    </parent>

    <artifactId>gateway.distribution</artifactId>
    <packaging>pom</packaging>

    <name>Kaazing Gateway Distribution</name>
    <description>A packaged and runnable .tar/.zip of the gateway</description>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.kaazing</groupId>
                <artifactId>gateway.bom</artifactId>
                <version>${project.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.truststore</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.server.api</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.server.spi</artifactId>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.check.update</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.bridge</artifactId>
        </dependency>

        <!-- Command Center / Management -->
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.management</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>snmp4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>snmp4j-agent</artifactId>
        </dependency>
        <!-- service dependencies -->
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.echo</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.broadcast</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.proxy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.http.balancer</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.http.directory</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.http.proxy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.update.check</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.update.check.management</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.http.redirect</artifactId>
        </dependency>

        <!-- transport dependencies -->
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.ssl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.wseb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.wsn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.ws</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.sse</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.http</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.pipe</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.nio</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.transport.bio</artifactId>
        </dependency>

        <!-- resource address dependencies -->
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.http</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.ws</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.ssl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.tcp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.wsn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.httpxe</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.wsdraft</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.wsxdraft</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.pipe</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.sse</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.wsx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.httpx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.httpxdraft</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.rtmp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.udp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.resource.address.wse</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>gateway.service.turn.rest</artifactId>
        </dependency>

        <!-- Shaded dependencies from mina.netty -->
        <!-- Create a submodule that extends mina.netty. Import it by excluding argona and slf4j. -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>3.10.5.Final</version>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>mina-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>mina-integration-beans</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.kaazing</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>mina-integration-jmx</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.kaazing</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.kaazing</groupId>
            <artifactId>mina-integration-ognl</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.kaazing</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xmlbeans-maven-plugin</artifactId>
                    <version>2.3.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.5.1</version>
                    <!-- turn off warnings about file lengths > 100 chars -->
                    <configuration>
                        <tarLongFileMode>gnu</tarLongFileMode>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <addMavenDescriptor>false</addMavenDescriptor>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${codehaus.license.version}</version>
                <configuration>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                    <thirdPartyFilename>NOTICE.txt</thirdPartyFilename>
                    <acceptPomPackaging>true</acceptPomPackaging>
                    <fileTemplate>org/kaazing/community/notice/third-party-template.ftl</fileTemplate>
                    <useMissingFile>true</useMissingFile>
                    <missingFile>src/license/THIRD-PARTY.properties</missingFile>
                    <failIfWarning>true</failIfWarning>
                    <excludedArtifacts>gateway.*|mina*</excludedArtifacts>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.kaazing</groupId>
                        <artifactId>community.notice</artifactId>
                        <version>${community.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>add-third-party</goal>
                        </goals>
                        <phase>generate-resources</phase>
                   </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.kaazing</groupId>
                        <artifactId>community.enforcer</artifactId>
                        <version>${community.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>default-enforce</id>
                        <configuration combine.self="override">
                            <skip>false</skip>
                            <rules>
                                <myCustomRule implementation="org.kaazing.community.enforcer.rule.RequireSameFile">
                                    <originalFilePath>../NOTICE.txt</originalFilePath>
                                    <revisedFilePath>${project.build.directory}/NOTICE.txt</revisedFilePath>
                                    <errorMessage>The top level Notice.txt file is not up-to-date. Update it and commit the changes.</errorMessage>
                                </myCustomRule>
                                <myCustomRule implementation="org.kaazing.community.enforcer.rule.RequireSameFile">
                                    <originalFilePath>${project.basedir}/src/main/gateway/NOTICE.txt</originalFilePath>
                                    <revisedFilePath>${project.build.directory}/NOTICE.txt</revisedFilePath>
                                    <errorMessage>The Notice.txt file from distribution/src/main/gateway is not up-to-date. Update it and commit the changes.</errorMessage>
                                </myCustomRule>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>process-resources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <filters>
                        <filter>${basedir}/src/main/assembly/filter.properties</filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <configuration>
                            <finalName>${gateway.edition.directory}</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/unix-bin.xml</descriptor>
                                <descriptor>src/main/assembly/windows-bin.xml</descriptor>
                            </descriptors>
                            <tarLongFileMode>posix</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <excludes combine.children="append">
                        <exclude>src/main/gateway/web/**/*</exclude>
                        <exclude>src/main/gateway/README.txt</exclude>
                        <exclude>src/main/gateway/NOTICE.txt</exclude>
                        <exclude>src/license/THIRD-PARTY.properties</exclude>
                    </excludes>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <properties>
        <keywords>HTML5,Kaazing,WebSocket,Gateway,Installer</keywords>
        <comments>(c) 2007-2015 Kaazing Corporation</comments>
        <edition>Community Edition Gateway</edition>

        <!-- gateway.feature.version supplies a 2-digit version of the major/minor version of the Gateway. -->
        <gateway.feature.version>${project.version}</gateway.feature.version>
        <gateway.edition.directory>kaazing-community-gateway-${project.version}</gateway.edition.directory>
        <minimum.java.version>Java 7 (version 1.7.0_21)</minimum.java.version>
        <gateway.version>${project.version}</gateway.version>
    </properties>
</project>
