<?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>ch.rabanti</groupId>
    <artifactId>nanoxlsx4j</artifactId>
    <version>2.4.2</version> <!-- Maintain also in demo and root project -->
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <name>NanoXLSX4j</name>
    <description>NanoXLSX4j is a small Java library to create and read XLSX files (Microsoft Excel 2007 or newer) in an
        easy and native way. The library is originated form PicoXLSX4j and has basic support of reading spreadsheets
    </description>
    <url>https://PicoXLSX.rabanti.ch</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Raphael Stoeckli</name>
            <email>github-dev@rabanti.ch</email>
            <organization>rabanti.ch</organization>
            <organizationUrl>https://picoxlsx.rabanti.ch</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/rabanti-github/NanoXLSX4j.git</connection>
        <url>https://github.com/rabanti-github/NanoXLSX4j/tree/master</url>
    </scm>

    <!-- DEV DEPENDENCIES -->
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.9.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <!-- DISTRIBUTION MANAGEMENT -->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <!-- BUILD -->
    <profiles>
        <!-- GITHUB PROFILE -->
        <profile>
            <id>github-release</id>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
                <plugins>
                    <!-- ATTACH JAVADOC -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <!-- Sonatype.org docs state v2.9.1; Available stable: v3.0.0 -->
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <tags>
                                <tag>
                                    <name>apiNote</name>
                                    <placement>a</placement>
                                    <head>API Note:</head>
                                </tag>
                                <tag>
                                    <name>implSpec</name>
                                    <placement>a</placement>
                                    <head>Implementation Requirements:</head>
                                </tag>
                                <tag>
                                    <name>implNote</name>
                                    <placement>a</placement>
                                    <head>Implementation Note:</head>
                                </tag>
                                <tag>
                                    <name>param</name>
                                </tag>
                                <tag>
                                    <name>return</name>
                                </tag>
                                <tag>
                                    <name>throws</name>
                                </tag>
                                <tag>
                                    <name>since</name>
                                </tag>
                                <tag>
                                    <name>version</name>
                                </tag>
                                <tag>
                                    <name>serialData</name>
                                </tag>
                                <tag>
                                    <name>see</name>
                                </tag>
                            </tags>
                        </configuration>
                    </plugin>
                    <!-- COPY FILES -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>filter-resources</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>resources</goal>
                                </goals>
                                <configuration>
                                    <delimiters>
                                        <delimiter>@</delimiter>
                                    </delimiters>
                                    <useDefaultDelimiters>false</useDefaultDelimiters>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-javadoc-docs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>../docs</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${basedir}/target/apidocs</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>dist</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${basedir}/target</directory>
                                            <filtering>true</filtering>
                                            <includes>
                                                <include>**/${project.artifactId}-${project.version}.jar</include>
                                                <include>**/${project.artifactId}-${project.version}-javadoc.jar</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- DEPLOY PROFILE -->
        <profile>
            <id>maven-release</id>
            <build>
                <plugins>
                    <!-- ATTACH SOURCES -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- ATTACH JAVADOC -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- GPG SIGNING -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- STAGING (preformed with 'mvn clean deploy' -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <!-- Set to false, to check manually on the repository before releasing (use 'mvn nexus-staging:release'; drop with 'mvn nexus-staging:drop') -->
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- ADD THE MAVEN RESOURCES PLUGIN CONFIGURATION HERE -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.1.0</version> <!-- Change to the latest version -->
                        <executions>
                            <execution>
                                <id>filter-resources</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>resources</goal>
                                </goals>
                                <configuration>
                                    <delimiters>
                                        <delimiter>@</delimiter>
                                    </delimiters>
                                    <useDefaultDelimiters>false</useDefaultDelimiters>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>