<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <ryft.gpg.key.id>PLACEHOLDER_FOR_GPG_KEY_ID</ryft.gpg.key.id>
    </properties>

    <groupId>io.ryft</groupId>
    <artifactId>common</artifactId>
    <version>0.3.6</version>
    <packaging>pom</packaging>

    <name>Ryft Spark Plugin</name>
    <description>A Spark agent for data processing and transformation</description>
    <url>https://github.com/ryft/spark</url>

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

    <developers>
        <developer>
            <name>Danny Mor</name>
            <email>danny@ryft.io</email>
            <organization>Ryft</organization>
            <organizationUrl>https://ryft.io</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git:@github.com/ryft-io/spark.git</connection>
        <developerConnection>scm:git:https://github.com/ryft-io/spark.git</developerConnection>
        <url>https://github.com/ryft-io/spark/tree/main</url>
        <tag>HEAD</tag>
    </scm>


    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>false</autoPublish>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.7</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <keyname>${ryft.gpg.key.id}</keyname>
                    <gpgArguments>
                        <arg>--batch</arg>
                        <arg>--yes</arg>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                    <useAgent>false</useAgent>
                    <passphraseServerId>gpg.passphrase</passphraseServerId>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.2</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.2</version>
                <configuration>
                    <argLine>
                        -Djava.security.manager=allow
                        --add-exports=java.base/sun.nio.ch=ALL-UNNAMED
                        --add-opens=java.base/java.lang=ALL-UNNAMED
                        --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
                        --add-opens=java.base/java.io=ALL-UNNAMED
                        --add-opens=java.base/java.util=ALL-UNNAMED
                    </argLine>
                    <excludes>
                        <exclude>**/*IT.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.46.0</version>
                <configuration>
                    <java>
                        <googleJavaFormat/>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>apply</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>spark-3.3_scala-2.12</id>
            <properties>
                <scala.binary.version>2.12</scala.binary.version>
                <!-- this is not the latest scala 2.11 version but the one used by spark 3.3 -->
                <scala.version>2.12.15</scala.version>
                <spark.version>3.3.0</spark.version>
                <spark.binary.version>3.3</spark.binary.version>
                <iceberg.version>1.0.0</iceberg.version>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.release>8</maven.compiler.release>
            </properties>
            <modules>
                <module>spark-3_3</module>
            </modules>
        </profile>
        <profile>
            <id>spark-3.3_scala-2.13</id>
            <properties>
                <artifactId>spark-plugin_2.13</artifactId>
                <scala.binary.version>2.13</scala.binary.version>
                <!-- this is not the latest scala 2.11 version but the one used by spark 3.3 -->
                <scala.version>2.13.8</scala.version>
                <spark.version>3.3.0</spark.version>
                <spark.binary.version>3.3</spark.binary.version>
                <iceberg.version>1.6.1</iceberg.version>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.release>8</maven.compiler.release>
            </properties>
            <modules>
                
                <module>spark-3_3</module>
            </modules>
        </profile>
        <profile>
            <id>spark-3.5_scala-2.12</id>
            <properties>
                <scala.binary.version>2.12</scala.binary.version>
                <!-- this is not the latest scala 2.11 version but the one used by spark 3.3 -->
                <scala.version>2.12.15</scala.version>
                <spark.version>3.5.3</spark.version>
                <spark.binary.version>3.5</spark.binary.version>
                <iceberg.version>1.9.2</iceberg.version>
                <maven.compiler.source>17</maven.compiler.source>
                <maven.compiler.target>17</maven.compiler.target>

            </properties>
            <modules>

                <module>spark-3_5</module>
            </modules>
        </profile>
        <profile>
            <id>spark-3.5_scala-2.13</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <scala.binary.version>2.13</scala.binary.version>
                <!-- this is not the latest scala 2.11 version but the one used by spark 3.3 -->
                <scala.version>2.13.8</scala.version>
                <spark.version>3.5.3</spark.version>
                <spark.binary.version>3.5</spark.binary.version>
                <iceberg.version>1.9.2</iceberg.version>
                <maven.compiler.source>17</maven.compiler.source>
                <maven.compiler.target>17</maven.compiler.target>

            </properties>
            <modules>
                
                <module>spark-3_5</module>
            </modules>
        </profile>
    </profiles>
</project>
