<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>31</version>
        <relativePath />
    </parent>

    <groupId>org.apache.seatunnel</groupId>
    <artifactId>seatunnel-shade</artifactId>
    <version>2.3.13</version>
    <packaging>pom</packaging>
    <name>SeaTunnel : Shade :</name>

    <url>https://seatunnel.apache.org</url>
    <inceptionYear>2025</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/seatunnel-shade</url>
        <connection>git@github.com:apache/seatunnel-shade.git</connection>
    </scm>

    <pluginRepositories>
        <pluginRepository>
            <!-- Allows exec-maven-plugin to resolve snapshot plugin dependencies -->
            <id>apache.snapshots.https</id>
            <name>${distMgmtSnapshotsName}</name>
            <url>${distMgmtSnapshotsUrl}</url>
        </pluginRepository>
    </pluginRepositories>

    <modules>
        <module>seatunnel-shade-hazelcast</module>
        <module>seatunnel-shade-hadoop3-uber</module>
        <module>seatunnel-shade-jackson</module>
        <module>seatunnel-shade-guava</module>
        <module>seatunnel-shade-hadoop-aws</module>
        <module>seatunnel-shade-arrow</module>
        <module>seatunnel-shade-hikari</module>
        <module>seatunnel-shade-thrift-service</module>
        <module>seatunnel-shade-janino</module>
        <module>seatunnel-shade-scala-compiler</module>
        <module>seatunnel-shade-jetty</module>
        <module>seatunnel-shade-commons-lang3</module>
    </modules>

    <properties>
        <e2e.dependency.skip>true</e2e.dependency.skip>
        <java.version>1.8</java.version>
        <spotless.version>2.29.0</spotless.version>
        <junit5.version>5.9.2</junit5.version>
        <skip.spotless>true</skip.spotless>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven-shade-plugin.version>3.3.0</maven-shade-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <maven-scm-provider-jgit.version>1.9.5</maven-scm-provider-jgit.version>
        <seatunnel.shade.package>org.apache.seatunnel.shade</seatunnel.shade.package>

        <jackson.version>2.13.3</jackson.version>
        <arrow.version>15.0.1</arrow.version>
        <enableSourceJarCreation>true</enableSourceJarCreation>
        <!--  SeaTunnel Engine use     -->
        <hazelcast.version>5.1</hazelcast.version>
        <hadoop-aws.version>3.1.4</hadoop-aws.version>
        <hadoop3.version>3.1.4</hadoop3.version>
        <guava.version>27.0-jre</guava.version>
        <hikari.version>4.0.3</hikari.version>
        <jetty.version>9.4.56.v20240826</jetty.version>
        <thrift-service.version>1.0.0</thrift-service.version>
        <janino.verion>3.0.11</janino.verion>
        <scala.version>2.13.11</scala.version>
        <scala.binary.version>2.13</scala.binary.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.36</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.13</version>
            </dependency>

            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.2</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>1.20</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.4.1</version>
                    <configuration>
                        <filters combine.children="append">
                            <filter>
                                <artifact>*</artifact>
                                <excludes>
                                    <exclude>META-INF/maven/**</exclude>
                                </excludes>
                            </filter>
                        </filters>
                        <transformers>
                            <!-- The service transformer is needed to merge META-INF/services files -->
                            <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 Seatunnel-shade</projectName>
                                <inceptionYear>${project.inceptionYear}</inceptionYear>
                                <encoding>UTF-8</encoding>
                            </transformer>
                        </transformers>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- Used to resolve variables in the 'version' tag -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <executions>
                        <execution>
                            <id>flatten</id>
                            <goals>
                                <goal>flatten</goal>
                            </goals>
                            <phase>package</phase>
                            <configuration>
                                <!-- The least invasive mode that effectively only resolves variables -->
                                <flattenMode>resolveCiFriendliesOnly</flattenMode>
                                <!-- By default, the resulting pom is written into the modules base directory to work around MNG-6405.
                                    We aren't affected, so we use the proper location. -->
                                <outputDirectory>${project.build.directory}</outputDirectory>
                            </configuration>
                        </execution>
                        <execution>
                            <id>flatten.clean</id>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                            <phase>clean</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>

        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>1.8.0</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.1.1,)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless.version}</version>
                <configuration>
                    <skip>${skip.spotless}</skip>
                    <java>
                        <excludes>
                            <exclude>src/main/java/org/apache/seatunnel/antlr4/generated/*.*</exclude>
                        </excludes>
                        <googleJavaFormat>
                            <version>1.7</version>
                            <style>AOSP</style>
                        </googleJavaFormat>
                        <removeUnusedImports />
                        <formatAnnotations />
                        <importOrder>
                            <order>org.apache.seatunnel.shade,org.apache.seatunnel,org.apache,org,,javax,java,\#</order>
                        </importOrder>
                        <replaceRegex>
                            <name>Remove wildcard imports</name>
                            <searchRegex>import\s+(static)*\s*[^\*\s]+\*;(\r\n|\r|\n)</searchRegex>
                            <replacement>$1</replacement>
                        </replaceRegex>
                        <replaceRegex>
                            <name>Block powermock</name>
                            <searchRegex>import\s+org\.powermock\.[^\*\s]*(|\*);(\r\n|\r|\n)</searchRegex>
                            <replacement>$1</replacement>
                        </replaceRegex>
                        <replaceRegex>
                            <name>Block jUnit4 imports</name>
                            <searchRegex>import\s+org\.junit\.[^jupiter][^\*\s]*(|\*);(\r\n|\r|\n)</searchRegex>
                            <replacement>$1</replacement>
                        </replaceRegex>
                    </java>
                    <pom>
                        <sortPom>
                            <encoding>UTF-8</encoding>
                            <nrOfIndentSpace>4</nrOfIndentSpace>
                            <keepBlankLines>true</keepBlankLines>
                            <indentBlankLines>false</indentBlankLines>
                            <indentSchemaLocation>true</indentSchemaLocation>
                            <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                            <sortModules>false</sortModules>
                            <sortExecutions>false</sortExecutions>
                            <predefinedSortOrder>custom_1</predefinedSortOrder>
                            <expandEmptyElements>false</expandEmptyElements>
                            <sortProperties>false</sortProperties>
                        </sortPom>
                        <replace>
                            <name>Leading blank line</name>
                            <search>project</search>
                            <replacement>project</replacement>
                        </replace>
                    </pom>
                    <markdown>
                        <includes>
                            <include>docs/**/*.md</include>
                        </includes>
                        <excludes>
                            <exclude>**/.github/**/*.md</exclude>
                        </excludes>
                        <flexmark />
                    </markdown>
                    <upToDateChecking>
                        <enabled>true</enabled>
                    </upToDateChecking>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <configuration>
                    <skip>${e2e.dependency.skip}</skip>
                    <appendOutput>true</appendOutput>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <tagBase>${project.version}</tagBase>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-jgit</artifactId>
                        <version>${maven-scm-provider-jgit.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>
