<?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>

    <groupId>com.github.ozlerhakan</groupId>
    <artifactId>poiji</artifactId>
    <version>5.0.0</version>
    <packaging>jar</packaging>

    <name>poiji</name>
    <description>
        Poiji allows you to map excel sheets to Java objects by means of Apache POI
    </description>
    <url>http://github.com/ozlerhakan/poiji</url>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Hakan Ozler</name>
            <email>ozler.hakan@gmail.com</email>
            <organization>poiji</organization>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/ozlerhakan/poiji.git</connection>
        <developerConnection>scm:git:ssh://github.com:ozlerhakan/poiji.git</developerConnection>
        <url>http://github.com/ozlerhakan/poiji/tree/master</url>
    </scm>

    <inceptionYear>2017</inceptionYear>

    <issueManagement>
        <system>github.com</system>
        <url>https://github.com/ozlerhakan/poiji/issues</url>
    </issueManagement>

    <properties>
        <apache.poi.version>5.4.1</apache.poi.version>
        <junit.version>4.13.2</junit.version>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <java.version>11</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${apache.poi.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>

        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.9.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>published</waitUntil>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.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.6.3</version>
                <dependencies>
                    <dependency>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                        <version>2.6</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <source>${jdk.source}</source>
                            <detectJavaApiLink>false</detectJavaApiLink>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Prevent gpg from using pinentry programs -->
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>javadoclint</id>
            <activation>
                <jdk>[11,)</jdk>
            </activation>
            <properties>
                <javadoc.none>-Xdoclint:none</javadoc.none>
            </properties>
        </profile>
        <profile>
            <id>java17-tests</id>
            <activation>
                <jdk>[17,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.13.0</version>
                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>test-compile</phase>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                                <configuration>
                                    <release>17</release>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java11-tests</id>
            <activation>
                <jdk>(,17)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.13.0</version>
                        <executions>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>test-compile</phase>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                                <configuration>
                                    <release>11</release>
                                    <testExcludes>
                                        <exclude>**/model/byid/CalculationRecord.java</exclude>
                                        <exclude>**/model/byid/ClassesRecord.java</exclude>
                                        <exclude>**/model/byname/EmployeeRecord.java</exclude>
                                        <exclude>**/model/byname/PersonRecord.java</exclude>
                                        <exclude>**/model/byname/OrgWithUnknownCellsRecord.java</exclude>
                                        <exclude>**/model/AlbumRecord.java</exclude>
                                        <exclude>**/RecordDeserializationTest.java</exclude>
                                        <exclude>**/util/ReflectUtilRecordEdgeCaseTest.java</exclude>
                                    </testExcludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.7</version>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
