<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2024 Hazelcast Inc.
  ~
  ~ Licensed under the Hazelcast Community License (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://hazelcast.com/hazelcast-community-license
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES 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>
    <packaging>jar</packaging>
    <name>hazelcast-jet-csv</name>
    <description>CSV support for Hazelcast Jet</description>
    <url>http://www.hazelcast.com/</url>

    <artifactId>hazelcast-jet-csv</artifactId>

    <parent>
        <groupId>com.hazelcast.jet</groupId>
        <artifactId>hazelcast-jet-extensions</artifactId>
        <version>5.5.0</version>
    </parent>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>com.hazelcast.jet.csv</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <!-- We must generate a -javadoc JAR file to publish on Maven Central -->
                        <id>empty-javadoc-jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                            <classesDirectory>${project.basedir}/src/main/javadoc</classesDirectory>
                            <excludes>
                                <exclude>.*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jar-with-dependencies</id>
                        <phase>${shade.jar-with-dependencies.phase}</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration combine.self="append">
                            <relocations>
                                <relocation>
                                    <pattern>com.fasterxml.jackson.core</pattern>
                                    <shadedPattern>${relocation.root}.com.fasterxml.jackson.core</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.fasterxml.jackson.databind</pattern>
                                    <shadedPattern>${relocation.root}.com.fasterxml.jackson.databind</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.fasterxml.jackson.dataformat</pattern>
                                    <shadedPattern>${relocation.root}.com.fasterxml.jackson.dataformat</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-csv</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
