<?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>
    <name>java-util</name>
    <groupId>com.cedarsoftware</groupId>
    <artifactId>java-util</artifactId>
    <packaging>bundle</packaging>
    <version>2.12.0</version>
    <description>Java Utilities</description>
    <url>https://github.com/jdereg/java-util</url>

    <developers>
        <developer>
            <id>jdereg</id>
            <name>John DeRegnaucourt</name>
            <email>jdereg@gmail.com</email>
        </developer>
        <developer>
            <id>kpartlow</id>
            <name>Kenny Partlow</name>
            <email>kpartlow@gmail.com</email>
        </developer>
    </developers>

    <properties>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss.SSSZ</maven.build.timestamp.format>
        <!-- remove source encoding warnings from maven output -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Java source, target, and release version -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.release>8</maven.compiler.release>

        <!-- testing only -->
        <version.junit-jupiter-api>5.10.2</version.junit-jupiter-api>
        <version.junit-jupiter-params>5.10.2</version.junit-jupiter-params>
        <version.mockito-junit-jupiter>4.11.0</version.mockito-junit-jupiter>
        <version.assertj-core>3.26.0</version.assertj-core>
        <version.json-io>4.25.0</version.json-io>
        <version.agrona>1.21.2</version.agrona>

        <!-- Build maven-***-plugins -->
        <version.maven-jar-plugin>3.4.2</version.maven-jar-plugin>
        <version.maven-gpg-plugin>3.2.4</version.maven-gpg-plugin>
        <version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
        <version.maven-javadoc-plugin>3.7.0</version.maven-javadoc-plugin>
        <version.maven-surefire-plugin>3.3.0</version.maven-surefire-plugin>
        <version.maven-source-plugin>3.3.1</version.maven-source-plugin>
        <version.maven-scr-plugin>1.26.4</version.maven-scr-plugin>
        <version.maven-bundle-plugin>5.1.9</version.maven-bundle-plugin>
        <version.moditect-maven-plugin>1.2.1.Final</version.moditect-maven-plugin>

        <!-- release to Maven Central via Sonatype Nexus -->
        <version.nexus-staging-maven-plugin>1.7.0</version.nexus-staging-maven-plugin>

    </properties>

    <profiles>

        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven-gpg-plugin}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphrase>${gpg.passphrase}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

    <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/jdereg/java-util</url>
        <connection>scm:git:git://github.com/jdereg/java-util.git</connection>
        <developerConnection>scm:git:git@github.com:jdereg/java-util.git</developerConnection>
    </scm>

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

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.maven-jar-plugin}</version> <!-- Use the latest version available -->
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Title>java-util</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor-Id>com.cedarsoftware</Implementation-Vendor-Id>
                            <Implementation-URL>https://github.com/jdereg/java-util</Implementation-URL>
                            <Built-By>${user.name}</Built-By>
                            <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
                            <Build-Jdk>${java.version} (${java.vendor} ${java.vm.version})</Build-Jdk>
                            <Build-OS>${os.name} ${os.arch} ${os.version}</Build-OS>
                        </manifestEntries>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <version>${version.maven-scr-plugin}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${version.maven-bundle-plugin}</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            java.sql,
                            java.xml</Import-Package>
                        <Export-Package>
                            com.cedarsoftware.util
                            com.cedarsoftware.util.convert
                        </Export-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <goals>
                            <goal>
                                manifest
                            </goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.maven-compiler-plugin}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${version.maven-source-plugin}</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>${version.maven-javadoc-plugin}</version>
                <configuration>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${version.nexus-staging-maven-plugin}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven-surefire-plugin}</version>
            </plugin>

            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
                <version>${version.moditect-maven-plugin}</version>
                <executions>
                    <execution>
                        <id>add-module-infos</id>
                        <goals>
                            <goal>add-module-info</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <jvmVersion>base</jvmVersion>
                            <module>
                                <moduleInfoSource>
                                    module com.cedarsoftware.util {
                                    requires java.sql;
                                    requires java.xml;
                                    exports com.cedarsoftware.util;
                                    exports com.cedarsoftware.util.convert;
                                    }
                                </moduleInfoSource>
                            </module>
                            <overwriteExistingFiles>true</overwriteExistingFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${version.junit-jupiter-api}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${version.junit-jupiter-params}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${version.mockito-junit-jupiter}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${version.assertj-core}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.cedarsoftware</groupId>
            <artifactId>json-io</artifactId>
            <version>${version.json-io}</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.agrona</groupId>
            <artifactId>agrona</artifactId>
            <version>${version.agrona}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
</project>

