<?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
with the License.  You may obtain a copy of the License at
  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">

    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>23</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.apache.flink</groupId>
    <artifactId>flink-kubernetes-operator-parent</artifactId>
    <version>1.15.0</version>

    <name>Flink Kubernetes: </name>
    <packaging>pom</packaging>
    <url>https://flink.apache.org</url>
    <inceptionYear>2014</inceptionYear>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/apache/flink-kubernetes-operator</url>
        <connection>git@github.com:apache/flink-kubernetes-operator.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git</developerConnection>
    </scm>

    <modules>
        <module>flink-kubernetes-standalone</module>
        <module>flink-kubernetes-operator</module>
        <module>flink-kubernetes-operator-api</module>
        <module>flink-kubernetes-webhook</module>
        <module>flink-kubernetes-docs</module>
        <module>flink-autoscaler</module>
        <module>flink-autoscaler-standalone</module>
        <module>flink-autoscaler-plugin-jdbc</module>
        <module>examples/flink-sql-runner-example</module>
        <module>examples/flink-beam-example</module>
        <module>examples/kubernetes-client-examples</module>
        <module>examples/autoscaling</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
        <git-commit-id-maven-plugin.version>5.0.0</git-commit-id-maven-plugin.version>

        <operator.sdk.version>5.2.2</operator.sdk.version>
        <operator.sdk.webhook-framework.version>3.0.0</operator.sdk.webhook-framework.version>

        <fabric8.version>7.3.1</fabric8.version>

        <lombok.version>1.18.30</lombok.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <commons-io.version>2.17.0</commons-io.version>
        <flink.version>1.20.1</flink.version>
        <guava.version>33.4.0-jre</guava.version>

        <slf4j.version>1.7.36</slf4j.version>
        <log4j.version>2.23.1</log4j.version>
        <logback.version>1.2.13</logback.version>

        <spotless.version>2.40.0</spotless.version>
        <it.skip>true</it.skip>

        <hamcrest.version>1.3</hamcrest.version>

        <okhttp.version>4.12.0</okhttp.version>
        <curator-test.version>5.7.0</curator-test.version>

        <assertj.version>3.26.3</assertj.version>

        <quartz.version>2.4.0</quartz.version>
        <hikari.version>5.1.0</hikari.version>

        <flink-kubernetes-operator.surefire.baseArgLine>-XX:+IgnoreUnrecognizedVMOptions ${surefire.module.config}</flink-kubernetes-operator.surefire.baseArgLine>

        <!-- This property should contain the add-opens/add-exports commands required for the tests
		     in the given module to pass.
		     It MUST be a space-separated list not containing any newlines,
		     of entries in the form '[-]{2}add-[opens|exports]=<module>/<package>=ALL-UNNAMED'.-->
        <surefire.module.config/>

        <derby.version>10.15.2.0</derby.version>
        <awaitility.version>4.2.2</awaitility.version>

        <!-- valid options can be checked at https://central.sonatype.com/search?q=kubernetes-httpclient- currently: okhttp, jdk, jetty, vertx -->
        <!-- when using a value other than okhttp disable the `depend-on-okhttp4` profile as well. -->
        <fabric8.httpclient.impl>okhttp</fabric8.httpclient.impl>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>2.15.0</version>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.9.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${fabric8.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>io.fabric8</groupId>
                        <artifactId>kubernetes-httpclient-vertx</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.squareup.okhttp3</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>io.fabric8</groupId>
                        <artifactId>kubernetes-httpclient-okhttp</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-server-mock</artifactId>
                <version>${fabric8.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>com.squareup.okhttp3</groupId>
                        <artifactId>mockwebserver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <!--
          We're reusing the apache-release build profile defined in the Apache Parent POM,
          with one exclusion: do not run the source-release-assembly execution goal.
          We have our own scripts to create the source release, which correctly excludes
          binaries from distribution tarball.
          The script can be found under tools/releasing/create_source_release.sh.
        -->
        <profile>
            <id>apache-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.apache.resources</groupId>
                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
                                <version>1.0.6</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>source-release-assembly</id>
                                <!-- disable the execution -->
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>generate-docs</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>doc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>depend-on-okhttp4</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.squareup.okhttp3</groupId>
                    <artifactId>okhttp</artifactId>
                    <version>${okhttp.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- This is picked up by IntelliJ -->
                    <argLine>${flink-kubernetes-operator.surefire.baseArgLine}</argLine>
                </configuration>
                <executions>
                    <execution>
                        <configuration>
                            <argLine>${flink-kubernetes-operator.surefire.baseArgLine}</argLine>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <skipITs>${it.skip}</skipITs>
                    <includes>
                        <include>**/*ITCase.*</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <suppressionsLocation>/tools/maven/suppressions.xml</suppressionsLocation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <configLocation>/tools/maven/checkstyle.xml</configLocation>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <failOnViolation>true</failOnViolation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.version}</version>
                <configuration>
                    <java>
                        <googleJavaFormat>
                            <version>1.17.0</version>
                            <style>AOSP</style>
                        </googleJavaFormat>

                        <!-- \# refers to the static imports -->
                        <importOrder>
                            <order>org.apache.flink,org.apache.flink.shaded,,javax,java,scala,\#</order>
                        </importOrder>

                        <removeUnusedImports />
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>0.16.1</version><!--$NO-MVN-MAN-VER$-->
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludeSubProjects>false</excludeSubProjects>
                    <numUnapprovedLicenses>0</numUnapprovedLicenses>
                    <licenses>
                        <!-- Enforce this license:
                            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
                            with the License.  You may obtain a copy of the License at
                              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.
                        -->
                        <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
                            <licenseFamilyCategory>AL2 </licenseFamilyCategory>
                            <licenseFamilyName>Apache License 2.0</licenseFamilyName>
                            <notes />
                            <patterns>
                                <pattern>Licensed to the Apache Software Foundation (ASF) under one</pattern>
                            </patterns>
                        </license>
                    </licenses>
                    <licenseFamilies>
                        <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
                            <familyName>Apache License 2.0</familyName>
                        </licenseFamily>
                    </licenseFamilies>
                    <excludes>
                        <!-- Additional files like .gitignore etc.-->
                        <exclude>**/.*/**</exclude>
                        <exclude>**/*.prefs</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>**/dependency-reduced-pom.xml</exclude>
                        <!-- Administrative files in the main trunk. -->
                        <exclude>**/README.md</exclude>
                        <exclude>.git/**</exclude>
                        <exclude>.github/**</exclude>
                        <!-- Build files -->
                        <exclude>**/*.iml</exclude>
                        <!-- Generated content -->
                        <exclude>**/target/**</exclude>
                        <exclude>apache-maven-3.2.5/**</exclude>
                        <!-- Documentation -->
                        <exclude>docs/static/font-awesome/**</exclude>
                        <exclude>docs/resources/**</exclude>
                        <exclude>docs/public/**</exclude>
                        <exclude>docs/themes/book/**</exclude>
                        <exclude>docs/assets/github.css</exclude>
                        <exclude>docs/static/js/anchor.min.js</exclude>
                        <exclude>docs/layouts/shortcodes/generated/**</exclude>
                        <!-- PyCharm -->
                        <exclude>**/.idea/**</exclude>
                        <!-- Generated CRD -->
                        <exclude>helm/flink-kubernetes-operator/crds/flinkbluegreendeployments.flink.apache.org-v1.yml</exclude>
                        <exclude>helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml</exclude>
                        <exclude>helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml</exclude>
                        <exclude>helm/flink-kubernetes-operator/crds/flinkstatesnapshots.flink.apache.org-v1.yml</exclude>
                        <exclude>rio.yml</exclude>
                        <!-- the licenses that are re-bundled -->
                        <exclude>**/packaged_licenses/LICENSE.*.txt</exclude>
                        <exclude>**/licenses/LICENSE*</exclude>
                        <exclude>**/licenses-binary/LICENSE*</exclude>
                        <exclude>tools/license/NOTICE-binary_PREAMBLE.txt</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- generate configuration docs -->
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>0.1</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>directory-of</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>rootDir</property>
                            <project>
                                <groupId>org.apache.flink</groupId>
                                <artifactId>flink-kubernetes-operator-parent</artifactId>
                            </project>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <transformers combine.children="append">
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                        <!-- The ApacheNoticeResourceTransformer collects and aggregates NOTICE files -->
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                            <projectName>Apache Flink</projectName>
                            <encoding>UTF-8</encoding>
                        </transformer>
                    </transformers>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <version>1.0.2</version>
                <configuration>
                    <indentSize>4</indentSize>
                    <useDefaultFormatFileSet>false</useDefaultFormatFileSet>
                    <formatFileSets>
                        <formatFileSet>
                            <directory>.</directory>
                            <includes>
                                <include>**/pom.xml</include>
                            </includes>
                        </formatFileSet>
                    </formatFileSets>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check-format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
                <version>2.9.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>makeBom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
