<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<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>
        <artifactId>streams-master</artifactId>
        <groupId>org.apache.streams</groupId>
        <version>0.4-incubating</version>
    </parent>

    <artifactId>streams-examples</artifactId>
    <version>0.4-incubating</version>

    <packaging>pom</packaging>
    <name>streams-examples</name>

    <description>Contributed examples of use cases for Streams.</description>

    <url>http://streams.incubator.apache.org/site/${project.version}/streams-examples</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:apache/incubator-streams-examples.git</connection>
        <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-streams-examples.git</developerConnection>
        <url>scm:git:git@github.com:apache/incubator-streams-examples.git</url>
        <tag>streams-examples-0.4-incubating</tag>
    </scm>

    <developers>
        <developer>
            <id>sblackmon</id>
            <name>Steve Blackmon</name>
            <email>sblackmon@apache.org</email>
            <url>https://github.com/steveblackmon</url>
            <organization>Apache Software Foundation</organization>
            <organizationUrl>http://streams.incubator.apache.org</organizationUrl>
        </developer>
    </developers>

    <issueManagement>
        <system>JIRA</system>
        <url>https://issues.apache.org/jira/browse/STREAMS</url>
    </issueManagement>

    <ciManagement>
        <system>jenkins</system>
        <url>http://builds.apache.org/job/Streams%20Examples/</url>
    </ciManagement>

    <prerequisites>
        <maven>3.0.5</maven>
    </prerequisites>

    <mailingLists>
        <mailingList>
            <name>Dev Mailing List</name>
            <post>dev@streams.incubator.apache.org</post>
            <subscribe>dev-subscribe@streams.incubator.apache.org</subscribe>
            <unsubscribe>dev-unsubscribe@streams.incubator.apache.org</unsubscribe>
        </mailingList>
        <mailingList>
            <name>User Mailing List</name>
            <post>user@streams.incubator.apache.org</post>
            <subscribe>user-subscribe@streams.incubator.apache.org</subscribe>
            <unsubscribe>user-unsubscribe@streams.incubator.apache.org</unsubscribe>
        </mailingList>
    </mailingLists>

    <distributionManagement>
        <site>
            <id>streams.site.examples</id>
            <url>scm:svn:https://svn.apache.org/repos/asf/incubator/streams/site/trunk/content/site/${project.version}/streams-examples/</url>
        </site>
    </distributionManagement>

    <repositories>
        <repository>
            <id>central-repo</id>
            <name>Maven Repository</name>
            <!-- HTTPS is unavailable for Maven Central -->
            <url>http://repo.maven.apache.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>apache-releases</id>
            <name>Apache Repository</name>
            <url>https://repository.apache.org/content/repositories/releases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>apache-snapshots</id>
            <name>Apache Repository</name>
            <url>https://repository.apache.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>clojars-repo</id>
            <name>Clojars Repository</name>
            <url>http://clojars.org/repo</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>cloudera-repo</id>
            <name>Cloudera Repository</name>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <properties>

        <!-- Release Properties -->
        <snapshot.repository.url>
            https://repository.apache.org/content/repositories/snapshots
        </snapshot.repository.url>
        <release.repository.url>
            https://repository.apache.org/service/local/staging/deploy/maven2
        </release.repository.url>

        <docker.plugin.version>0.15.0</docker.plugin.version>

    </properties>

    <modules>
        <module>flink</module>
        <module>local</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <type>jar</type>
                <version>1.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-config</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-core</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-filters</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-pojo</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-pojo</artifactId>
                <version>0.4-incubating</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-util</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-util</artifactId>
                <version>0.4-incubating</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-pojo-extensions</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-runtime-local</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-provider-twitter</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-persist-elasticsearch</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-persist-graph</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-persist-hdfs</artifactId>
                <version>0.4-incubating</version>
            </dependency>
            <dependency>
                <groupId>org.apache.streams</groupId>
                <artifactId>streams-persist-mongo</artifactId>
                <version>0.4-incubating</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${shade.plugin.version}</version>
                    <configuration>
                        <outputDirectory>dist</outputDirectory>
                        <outputFile>dist/${project.artifactId}-jar-with-dependencies.jar</outputFile>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>**/META-INF/**</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <finalName>${project.build.finalName}</finalName>
                                <filters>
                                    <filter>
                                        <artifact>*:*</artifact>
                                        <excludes>
                                            <exclude>META-INF/*.SF</exclude>
                                            <exclude>META-INF/*.DSA</exclude>
                                            <exclude>META-INF/*.RSA</exclude>
                                            <exclude>**/logback.xml</exclude>
                                            <exclude>**/log4j.properties</exclude>
                                        </excludes>
                                    </filter>
                                </filters>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                        <resource>reference.conf</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                        <resource>application.conf</resource>
                                    </transformer>
                                    <!--<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">-->
                                    <!--<manifestEntries>-->
                                    <!--<Main-Class>akka.Main</Main-Class>-->
                                    <!--</manifestEntries>-->
                                    <!--</transformer>-->
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>docker</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>docker.repo</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <version>${docker.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>build</goal>
                                    <goal>push</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration combine.self="append">
                            <watchInterval>500</watchInterval>
                            <logDate>default</logDate>
                            <verbose>true</verbose>
                            <images>
                                <image>
                                    <name>${docker.repo}/${project.artifactId}</name>
                                    <alias>${project.artifactId}</alias>
                                    <build>
                                        <from>1science/java</from>
                                        <maintainer>sblackmon@apache.org</maintainer>
                                        <env>
                                            <LANG>en_US.UTF-8</LANG>
                                            <LC_ALL>en_US.UTF-8</LC_ALL>
                                        </env>
                                        <tags>
                                            <tag>${project.version}</tag>
                                            <tag>latest</tag>
                                        </tags>
                                        <assembly>
                                            <mode>tar</mode>
                                            <basedir>/</basedir>
                                            <inline>
                                                <baseDirectory>/</baseDirectory>
                                                <fileSets>
                                                    <fileSet>
                                                        <directory>dist</directory>
                                                        <outputDirectory>/</outputDirectory>
                                                    </fileSet>
                                                </fileSets>
                                            </inline>
                                        </assembly>
                                    </build>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>dockerITs</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>skipITs</name>
                    <value>false</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <version>${docker.plugin.version}</version>
                        <configuration combine.self="override">
                            <watchInterval>500</watchInterval>
                            <logDate>default</logDate>
                            <verbose>true</verbose>
                            <autoPull>on</autoPull>
                            <images>
                                <image>
                                    <name>elasticsearch:2.3.5</name>
                                    <alias>elasticsearch</alias>
                                    <run>
                                        <namingStrategy>none</namingStrategy>
                                        <ports>
                                            <port>${es.http.host}:${es.http.port}:9200</port>
                                            <port>${es.tcp.host}:${es.tcp.port}:9300</port>
                                        </ports>
                                        <portPropertyFile>elasticsearch.properties</portPropertyFile>
                                        <wait>
                                            <log>elasticsearch startup</log>
                                            <http>
                                                <url>http://${es.http.host}:${es.http.port}</url>
                                                <method>GET</method>
                                                <status>200</status>
                                            </http>
                                            <time>20000</time>
                                            <kill>1000</kill>
                                            <shutdown>500</shutdown>
                                            <!--<tcp>-->
                                            <!--<host>${es.transport.host}</host>-->
                                            <!--<ports>-->
                                            <!--<port>${es.transport.port}</port>-->
                                            <!--</ports>-->
                                            <!--</tcp>-->
                                        </wait>
                                        <log>
                                            <enabled>true</enabled>
                                            <date>default</date>
                                            <color>cyan</color>
                                        </log>
                                    </run>
                                    <watch>
                                        <mode>none</mode>
                                    </watch>
                                </image>
                                <image>
                                    <name>mongo:3.2.0</name>
                                    <alias>mongo</alias>
                                    <run>
                                        <namingStrategy>none</namingStrategy>
                                        <ports>
                                            <port>${mongo.tcp.host}:${mongo.tcp.port}:27017</port>
                                        </ports>
                                        <portPropertyFile>mongo.properties</portPropertyFile>
                                        <log>
                                            <enabled>true</enabled>
                                            <date>default</date>
                                            <color>cyan</color>
                                        </log>
                                    </run>
                                    <watch>
                                        <mode>none</mode>
                                    </watch>
                                </image>
                                <image>
                                    <name>neo4j</name>
                                    <alias>graph</alias>
                                    <run>
                                        <env>
                                            <NEO4J_AUTH>none</NEO4J_AUTH>
                                        </env>
                                        <namingStrategy>none</namingStrategy>
                                        <ports>
                                            <port>${neo4j.http.host}:${neo4j.http.port}:7474</port>
                                            <port>${neo4j.tcp.host}:${neo4j.tcp.port}:7687</port>
                                        </ports>
                                        <portPropertyFile>neo4j.properties</portPropertyFile>
                                        <wait>
                                            <log>graph startup</log>
                                            <http>
                                                <url>http://${neo4j.http.host}:${neo4j.http.port}</url>
                                                <method>GET</method>
                                                <status>200</status>
                                            </http>
                                            <time>20000</time>
                                            <kill>1000</kill>
                                            <shutdown>500</shutdown>
                                            <!--<tcp>-->
                                            <!--<host>${es.transport.host}</host>-->
                                            <!--<ports>-->
                                            <!--<port>${es.transport.port}</port>-->
                                            <!--</ports>-->
                                            <!--</tcp>-->
                                        </wait>
                                        <log>
                                            <enabled>true</enabled>
                                            <date>default</date>
                                            <color>cyan</color>
                                        </log>
                                    </run>
                                    <watch>
                                        <mode>none</mode>
                                    </watch>
                                </image>
                            </images>
                        </configuration>

                    </plugin>

                </plugins>
            </build>

        </profile>

        <profile>
            <id>contrib-check</id>
            <properties>
                <skipTests>false</skipTests>
                <maven.test.skip>false</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.rat</groupId>
                        <artifactId>apache-rat-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
