<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>stream-applications-release-train</artifactId>
        <groupId>org.springframework.cloud.stream.app</groupId>
        <version>${revision}</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>stream-applications-descriptor</artifactId>
    <name>stream-applications-descriptor</name>
    <packaging>jar</packaging>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>META-INF/kafka-apps-maven.properties</include>
                    <include>META-INF/rabbit-apps-maven.properties</include>
                    <include>META-INF/kafka-apps-docker.properties</include>
                    <include>META-INF/kafka-apps-harbor.properties</include>
                    <include>META-INF/rabbit-apps-docker.properties</include>
                    <include>META-INF/rabbit-apps-harbor.properties</include>
                    <include>META-INF/kafka-apps-maven-repo-url.properties</include>
                    <include>META-INF/rabbit-apps-maven-repo-url.properties</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source><![CDATA[
        pom.properties['repo-spring-io']=
                "${jdbc-source.version}".contains('SNAPSHOT') ? 'repo.spring.io/snapshot' :
                        "${jdbc-source.version}".contains('-') ? 'repo.spring.io/milestone' : 'repo.maven.apache.org/maven2'
        pom.properties['cdc-debezium-source-docker.tag']=
                "${cdc-debezium-source.version}".contains('SNAPSHOT') ? 'latest' : "${cdc-debezium-source.version}"
        pom.properties['file-source-docker.tag']=
                "${file-source.version}".contains('SNAPSHOT') ? 'latest' : "${file-source.version}"
        pom.properties['ftp-source-docker.tag']=
                "${ftp-source.version}".contains('SNAPSHOT') ? 'latest' : "${ftp-source.version}"
        pom.properties['geode-source-docker.tag']=
                "${geode-source.version}".contains('SNAPSHOT') ? 'latest' : "${geode-source.version}"
        pom.properties['http-source-docker.tag']=
                "${http-source.version}".contains('SNAPSHOT') ? 'latest' : "${http-source.version}"
        pom.properties['jdbc-source-docker.tag']=
                "${jdbc-source.version}".contains('SNAPSHOT') ? 'latest' : "${jdbc-source.version}"
        pom.properties['jms-source-docker.tag']=
                "${jms-source.version}".contains('SNAPSHOT') ? 'latest' : "${jms-source.version}"
        pom.properties['load-generator-source-docker.tag']=
                "${load-generator-source.version}".contains('SNAPSHOT') ? 'latest' : "${load-generator-source.version}"
        pom.properties['mail-source-docker.tag']=
                "${mail-source.version}".contains('SNAPSHOT') ? 'latest' : "${mail-source.version}"
        pom.properties['mongodb-source-docker.tag']=
                "${mongodb-source.version}".contains('SNAPSHOT') ? 'latest' : "${mongodb-source.version}"
        pom.properties['mqtt-source-docker.tag']=
                "${mqtt-source.version}".contains('SNAPSHOT') ? 'latest' : "${mqtt-source.version}"
        pom.properties['rabbit-source-docker.tag']=
                "${rabbit-source.version}".contains('SNAPSHOT') ? 'latest' : "${rabbit-source.version}"
        pom.properties['s3-source-docker.tag']=
                "${s3-source.version}".contains('SNAPSHOT') ? 'latest' : "${s3-source.version}"
        pom.properties['sftp-source-docker.tag']=
                "${sftp-source.version}".contains('SNAPSHOT') ? 'latest' : "${sftp-source.version}"
        pom.properties['syslog-source-docker.tag']=
                "${syslog-source.version}".contains('SNAPSHOT') ? 'latest' : "${syslog-source.version}"
        pom.properties['tcp-source-docker.tag']=
                "${tcp-source.version}".contains('SNAPSHOT') ? 'latest' : "${tcp-source.version}"
        pom.properties['time-source-docker.tag']=
                "${time-source.version}".contains('SNAPSHOT') ? 'latest' : "${time-source.version}"
        pom.properties['twitter-message-source-docker.tag']=
                "${twitter-message-source.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-message-source.version}"
        pom.properties['twitter-search-source-docker.tag']=
                "${twitter-search-source.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-search-source.version}"
        pom.properties['twitter-stream-source-docker.tag']=
                "${twitter-stream-source.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-stream-source.version}"
        pom.properties['websocket-source-docker.tag']=
                "${websocket-source.version}".contains('SNAPSHOT') ? 'latest' : "${websocket-source.version}"
        pom.properties['cassandra-sink-docker.tag']=
                "${cassandra-sink.version}".contains('SNAPSHOT') ? 'latest' : "${cassandra-sink.version}"
        pom.properties['analytics-sink-docker.tag']=
                "${analytics-sink.version}".contains('SNAPSHOT') ? 'latest' : "${analytics-sink.version}"
        pom.properties['elasticsearch-sink-docker.tag']=
                "${elasticsearch-sink.version}".contains('SNAPSHOT') ? 'latest' : "${elasticsearch-sink.version}"
        pom.properties['wavefront-sink-docker.tag']=
                "${wavefront-sink.version}".contains('SNAPSHOT') ? 'latest' : "${wavefront-sink.version}"
        pom.properties['file-sink-docker.tag']=
                "${file-sink.version}".contains('SNAPSHOT') ? 'latest' : "${file-sink.version}"
        pom.properties['ftp-sink-docker.tag']=
                "${ftp-sink.version}".contains('SNAPSHOT') ? 'latest' : "${ftp-sink.version}"
        pom.properties['geode-sink-docker.tag']=
                "${geode-sink.version}".contains('SNAPSHOT') ? 'latest' : "${geode-sink.version}"
        pom.properties['jdbc-sink-docker.tag']=
                "${jdbc-sink.version}".contains('SNAPSHOT') ? 'latest' : "${jdbc-sink.version}"
        pom.properties['log-sink-docker.tag']=
                "${log-sink.version}".contains('SNAPSHOT') ? 'latest' : "${log-sink.version}"
        pom.properties['mongodb-sink-docker.tag']=
                "${mongodb-sink.version}".contains('SNAPSHOT') ? 'latest' : "${mongodb-sink.version}"
        pom.properties['mqtt-sink-docker.tag']=
                "${mqtt-sink.version}".contains('SNAPSHOT') ? 'latest' : "${mqtt-sink.version}"
        pom.properties['pgcopy-sink-docker.tag']=
                "${pgcopy-sink.version}".contains('SNAPSHOT') ? 'latest' : "${pgcopy-sink.version}"
        pom.properties['rabbit-sink-docker.tag']=
                "${rabbit-sink.version}".contains('SNAPSHOT') ? 'latest' : "${rabbit-sink.version}"
        pom.properties['redis-sink-docker.tag']=
                "${redis-sink.version}".contains('SNAPSHOT') ? 'latest' : "${redis-sink.version}"
        pom.properties['router-sink-docker.tag']=
                "${router-sink.version}".contains('SNAPSHOT') ? 'latest' : "${router-sink.version}"
        pom.properties['rsocket-sink-docker.tag']=
                "${rsocket-sink.version}".contains('SNAPSHOT') ? 'latest' : "${rsocket-sink.version}"
        pom.properties['s3-sink-docker.tag']=
                "${s3-sink.version}".contains('SNAPSHOT') ? 'latest' : "${s3-sink.version}"
        pom.properties['sftp-sink-docker.tag']=
                "${sftp-sink.version}".contains('SNAPSHOT') ? 'latest' : "${sftp-sink.version}"
        pom.properties['tasklauncher-sink-docker.tag']=
                "${tasklauncher-sink.version}".contains('SNAPSHOT') ? 'latest' : "${tasklauncher-sink.version}"
        pom.properties['tcp-sink-docker.tag']=
                "${tcp-sink.version}".contains('SNAPSHOT') ? 'latest' : "${tcp-sink.version}"
        pom.properties['throughput-sink-docker.tag']=
                "${throughput-sink.version}".contains('SNAPSHOT') ? 'latest' : "${throughput-sink.version}"
        pom.properties['twitter-message-sink-docker.tag']=
                "${twitter-message-sink.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-message-sink.version}"
        pom.properties['twitter-update-sink-docker.tag']=
                "${twitter-update-sink.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-update-sink.version}"
        pom.properties['websocket-sink-docker.tag']=
                "${websocket-sink.version}".contains('SNAPSHOT') ? 'latest' : "${websocket-sink.version}"
        pom.properties['aggregator-processor-docker.tag']=
                "${aggregator-processor.version}".contains('SNAPSHOT') ? 'latest' : "${aggregator-processor.version}"
        pom.properties['bridge-processor-docker.tag']=
                "${bridge-processor.version}".contains('SNAPSHOT') ? 'latest' : "${bridge-processor.version}"
        pom.properties['filter-processor-docker.tag']=
                "${filter-processor.version}".contains('SNAPSHOT') ? 'latest' : "${filter-processor.version}"
        pom.properties['groovy-processor-docker.tag']=
                "${groovy-processor.version}".contains('SNAPSHOT') ? 'latest' : "${groovy-processor.version}"
        pom.properties['header-enricher-processor-docker.tag']=
                "${header-enricher-processor.version}".contains('SNAPSHOT') ? 'latest' : "${header-enricher-processor.version}"
        pom.properties['http-request-processor-docker.tag']=
                "${http-request-processor.version}".contains('SNAPSHOT') ? 'latest' : "${http-request-processor.version}"
        pom.properties['image-recognition-processor-docker.tag']=
                "${image-recognition-processor.version}".contains('SNAPSHOT') ? 'latest' : "${image-recognition-processor.version}"
        pom.properties['object-detection-processor-docker.tag']=
                "${object-detection-processor.version}".contains('SNAPSHOT') ? 'latest' : "${object-detection-processor.version}"
        pom.properties['semantic-segmentation-processor-docker.tag']=
                "${semantic-segmentation-processor.version}".contains('SNAPSHOT') ? 'latest' : "${semantic-segmentation-processor.version}"
        pom.properties['script-processor-docker.tag']=
                "${script-processor.version}".contains('SNAPSHOT') ? 'latest' : "${script-processor.version}"
        pom.properties['splitter-processor-docker.tag']=
                "${splitter-processor.version}".contains('SNAPSHOT') ? 'latest' : "${splitter-processor.version}"
        pom.properties['transform-processor-docker.tag']=
                "${transform-processor.version}".contains('SNAPSHOT') ? 'latest' : "${transform-processor.version}"
        pom.properties['twitter-trend-processor-docker.tag']=
                "${twitter-trend-processor.version}".contains('SNAPSHOT') ? 'latest' : "${twitter-trend-processor.version}"
                                ]]></source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/classes/META-INF/kafka-apps-maven.properties</file>
                                    <type>stream-apps-kafka-maven</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/kafka-apps-docker.properties</file>
                                    <type>stream-apps-kafka-docker</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/kafka-apps-harbor.properties</file>
                                    <type>stream-apps-kafka-harbor</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/rabbit-apps-maven.properties</file>
                                    <type>stream-apps-rabbit-maven</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/rabbit-apps-docker.properties</file>
                                    <type>stream-apps-rabbit-docker</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/rabbit-apps-harbor.properties</file>
                                    <type>stream-apps-rabbit-harbor</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/kafka-apps-maven-repo-url.properties</file>
                                    <type>kafka-apps-maven-repo-url.properties</type>
                                </artifact>
                                <artifact>
                                    <file>target/classes/META-INF/rabbit-apps-maven-repo-url.properties</file>
                                    <type>rabbit-apps-maven-repo-url.properties</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

</project>
