<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>
    <artifactId>stream-applications-core</artifactId>
    <version>${revision}</version>
    <name>stream-applications-core</name>
    <description>Stream Applications Core Parent</description>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.cloud.stream.app</groupId>
        <artifactId>stream-applications-build</artifactId>
        <version>4.0.0-SNAPSHOT</version>
        <relativePath/>
    </parent>

    <properties>
        <revision>4.0.0-SNAPSHOT</revision>
        <stream-apps-core.version>${revision}</stream-apps-core.version>
        <java-functions.version>4.0.0-SNAPSHOT</java-functions.version>
        <apps.base-image>springcloud/baseimage:1.0.1</apps.base-image>
        <spring-cloud-dataflow-apps-generator-plugin.version>1.0.7</spring-cloud-dataflow-apps-generator-plugin.version>
        <spring-cloud-dataflow-apps-docs-plugin.version>1.0.7</spring-cloud-dataflow-apps-docs-plugin.version>
        <spring-cloud-dataflow-apps-metadata-plugin.version>1.0.7</spring-cloud-dataflow-apps-metadata-plugin.version>
        <java-cfenv-boot.version>2.4.0</java-cfenv-boot.version>
        <prometheus-rsocket.version>1.4.0</prometheus-rsocket.version>
        <wavefront-spring-boot.version>2.2.2</wavefront-spring-boot.version>
    </properties>

    <modules>
        <module>stream-applications-test-support</module>
        <module>stream-applications-postprocessor-common</module>
        <module>stream-applications-micrometer-common</module>
        <module>stream-applications-security-common</module>
        <module>stream-applications-composite-function-support</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud.fn</groupId>
                <artifactId>function-dependencies</artifactId>
                <version>${java-functions.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-function-dependencies</artifactId>
                <version>${spring-cloud-function.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-stream-dependencies</artifactId>
                <version>${spring-cloud-stream-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
			<dependency>
				<groupId>org.mock-server</groupId>
				<artifactId>mockserver-netty</artifactId>
				<version>${mockserver.version}</version>
			</dependency>
			<dependency>
				<groupId>org.mock-server</groupId>
				<artifactId>mockserver-client-java</artifactId>
				<version>${mockserver.version}</version>
			</dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
            <type>test-jar</type>
            <classifier>test-binder</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dataflow-apps-docs-plugin</artifactId>
                    <version>${spring-cloud-dataflow-apps-docs-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>generate-documentation</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>generate-documentation</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dataflow-apps-generator-plugin</artifactId>
                    <version>${spring-cloud-dataflow-apps-generator-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>app-gen</id>
                            <phase>package</phase>
                            <goals>
                                <goal>generate-app</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <generatedProjectHome>${basedir}/apps</generatedProjectHome>
                        <global>
                            <application>
                                <bootVersion>${spring-boot.version}</bootVersion>
                                <containerImage>
                                    <orgName>springcloudstream</orgName>
                                    <baseImage>${apps.base-image}</baseImage>
                                    <enableMetadata>true</enableMetadata>
                                </containerImage>
                                <properties>
                                    <!-- Disable all meter repositories by default.  -->
                                    <management.metrics.export.wavefront.enabled>false</management.metrics.export.wavefront.enabled>
                                    <management.metrics.export.influx.enabled>false</management.metrics.export.influx.enabled>
                                    <management.metrics.export.prometheus.enabled>false</management.metrics.export.prometheus.enabled>
                                    <management.metrics.export.prometheus.rsocket.enabled>false</management.metrics.export.prometheus.rsocket.enabled>
                                    <management.metrics.export.datadog.enabled>false</management.metrics.export.datadog.enabled>

                                    <!-- Add SCDF stream metrics tags. -->
                                    <management.metrics.tags.stream.name>"${spring.cloud.dataflow.stream.name:unknown}"</management.metrics.tags.stream.name>
                                    <management.metrics.tags.application.name>"${spring.cloud.dataflow.stream.app.label:unknown}"</management.metrics.tags.application.name>
                                    <management.metrics.tags.application.type>"${spring.cloud.dataflow.stream.app.type:unknown}"</management.metrics.tags.application.type>
                                    <management.metrics.tags.instance.index>"${spring.cloud.stream.instanceIndex:0}"</management.metrics.tags.instance.index>
                                    <management.metrics.tags.application.guid>"${spring.cloud.application.guid:unknown}"</management.metrics.tags.application.guid>

                                    <!-- Wavefront Tracing -->
                                    <wavefront.application.name>"${spring.cloud.dataflow.stream.name:unknown}</wavefront.application.name>
                                    <wavefront.application.service>${spring.cloud.dataflow.stream.app.label:unknown}-${spring.cloud.dataflow.stream.app.type:unknown}"</wavefront.application.service>

                                    <!-- Zipkin Server Tracing -->
                                    <spring.zipkin.enabled>false</spring.zipkin.enabled>

                                    <!-- Enforce Spring Integration tracing instrumentation even for SCF apps -->
                                    <spring.sleuth.integration.enabled>true</spring.sleuth.integration.enabled>
                                    <spring.sleuth.sampler.probability>1.0</spring.sleuth.sampler.probability>

									<!-- Temporarily disable Spring Cloud Sleuth function instrumentation -->
									<spring.sleuth.function.enabled>false</spring.sleuth.function.enabled>

                                </properties>
                                <metadata>
                                    <mavenPluginVersion>${spring-cloud-dataflow-apps-metadata-plugin.version}</mavenPluginVersion>
                                </metadata>
                                <maven>
                                    <dependencyManagement>
                                        <!-- Temporarily override SC-Fn dependency by giving it the highest precedence since 2020.0.5 release of spring-cloud will not take place until December -->
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-function-dependencies</artifactId>
                                            <version>${spring-cloud-function.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-stream-dependencies</artifactId>
                                            <version>${spring-cloud-stream-dependencies.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-dependencies</artifactId>
                                            <version>${spring-cloud.version}</version>
                                            <type>pom</type>
                                            <scope>import</scope>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud.fn</groupId>
                                            <artifactId>function-dependencies</artifactId>
                                            <version>${java-functions.version}</version>
                                        </dependency>

                                        <dependency>
                                            <groupId>com.wavefront</groupId>
                                            <artifactId>wavefront-spring-boot-bom</artifactId>
                                            <version>${wavefront-spring-boot.version}</version>
                                            <type>pom</type>
                                            <scope>import</scope>
                                        </dependency>
                                    </dependencyManagement>
                                    <dependencies>
                                        <dependency>
                                            <groupId>org.springframework.cloud.stream.app</groupId>
                                            <artifactId>stream-applications-security-common</artifactId>
                                            <version>${stream-apps-core.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud.stream.app</groupId>
                                            <artifactId>stream-applications-micrometer-common</artifactId>
                                            <version>${stream-apps-core.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud.stream.app</groupId>
                                            <artifactId>stream-applications-postprocessor-common</artifactId>
                                            <version>${stream-apps-core.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.micrometer</groupId>
                                            <artifactId>micrometer-registry-influx</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.micrometer</groupId>
                                            <artifactId>micrometer-registry-prometheus</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.micrometer.prometheus</groupId>
                                            <artifactId>prometheus-rsocket-spring</artifactId>
                                            <version>${prometheus-rsocket.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.micrometer</groupId>
                                            <artifactId>micrometer-registry-datadog</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.micrometer</groupId>
                                            <artifactId>micrometer-registry-wavefront</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.pivotal.cfenv</groupId>
                                            <artifactId>java-cfenv-boot</artifactId>
                                            <version>${java-cfenv-boot.version}</version>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.boot</groupId>
                                            <artifactId>spring-boot-configuration-processor</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.boot</groupId>
                                            <artifactId>spring-boot-starter-actuator</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.boot</groupId>
                                            <artifactId>spring-boot-starter-web</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.boot</groupId>
                                            <artifactId>spring-boot-starter-logging</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.boot</groupId>
                                            <artifactId>spring-boot-starter-security</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>com.wavefront</groupId>
                                            <artifactId>wavefront-spring-boot-starter</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-starter-sleuth</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>org.springframework.cloud</groupId>
                                            <artifactId>spring-cloud-starter-config</artifactId>
                                        </dependency>
                                        <dependency>
                                            <groupId>io.pivotal.spring.cloud</groupId>
                                            <artifactId>spring-cloud-services-starter-config-client</artifactId>
                                            <version>3.2.0.RELEASE</version>
                                        </dependency>
                                    </dependencies>
                                </maven>
                            </application>
                            <binders>
                                <kafka>
                                    <maven>
                                        <dependencies>
                                            <dependency>
                                                <groupId>org.springframework.cloud</groupId>
                                                <artifactId>spring-cloud-stream-binder-kafka</artifactId>
                                            </dependency>
                                        </dependencies>
                                    </maven>
                                </kafka>
                                <rabbit>
                                    <maven>
                                        <dependencies>
                                            <dependency>
                                                <groupId>org.springframework.cloud</groupId>
                                                <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
                                            </dependency>
                                        </dependencies>
                                    </maven>
                                </rabbit>
                            </binders>
                        </global>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
