<?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>org.deepsymmetry</groupId>
    <artifactId>crate-digger</artifactId>
    <version>0.2.0</version>
    <packaging>jar</packaging>

    <name>Crate Digger</name>
    <description>Java library for parsing rekordbox collection exports and track analysis files.</description>
    <url>https://github.com/Deep-Symmetry/crate-digger</url>

    <organization>
        <name>Deep Symmetry, LLC</name>
        <url>http://deepsymmetry.org</url>
    </organization>

    <licenses>
        <license>
            <name>Eclipse Public License 1.0</name>
            <url>http://opensource.org/licenses/eclipse-1.0.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/Deep-Symmetry/crate-digger.git</url>
    </scm>

    <developers>
        <developer>
            <id>brunchboy</id>
            <name>James Elliott</name>
            <email>james@deepsymmetry.org</email>
            <organization>Deep Symmetry, LLC</organization>
            <organizationUrl>http://deepsymmetry.org</organizationUrl>
            <roles>
                <role>Project-Creator</role>
                <role>Developer</role>
            </roles>
            <timezone>America/Chicago</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <slf4jVersion>1.7.25</slf4jVersion>
    </properties>

    <dependencies>
        <!-- Kaitai Struct Compiler runtime for Java -->
        <dependency>
            <groupId>io.kaitai</groupId>
            <artifactId>kaitai-struct-runtime</artifactId>
            <version>0.10</version>
        </dependency>

        <!-- Remote Tea -->
        <dependency>
            <groupId>org.acplt.remotetea</groupId>
            <artifactId>remotetea-oncrpc</artifactId>
            <version>1.1.4</version>
        </dependency>

        <!-- Simple Logging Facade for Java -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4jVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4jVersion}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-M2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Automatic-Module-Name>org.deepsymmetry.cratedigger</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <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>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>name.valery1707.kaitai</groupId>
                <artifactId>kaitai-maven-plugin</artifactId>
                <version>0.1.6</version>
                <configuration>
                    <version>0.10</version>
                    <url>https://github.com/kaitai-io/kaitai_struct_compiler/releases/download/0.10/kaitai-struct-compiler-0.10.zip</url>
                    <sourceDirectory>src/main/kaitai</sourceDirectory>
                    <packageName>org.deepsymmetry.cratedigger.pdb</packageName>
                    <overwrite>true</overwrite>
                </configuration>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.acplt.remotetea</groupId>
                <artifactId>remotetea-maven-plugin</artifactId>
                <version>1.1.4</version>
                <executions>
                    <execution>
                        <id>jrpcgen.nfs</id>
                        <goals>
                            <goal>client</goal>
                        </goals>
                        <configuration>
                            <xFile>src/main/rpc/nfs.x</xFile>
                            <destDir>${project.build.directory}/generated-sources/remotetea</destDir>
                            <packageName>org.deepsymmetry.cratedigger.rpc</packageName>
                            <!-- Force the creation of the destination directory
                                 if it does not already exist at generation time. -->
                            <createDir>true</createDir>
                            <!-- Uncomment the following line to create
                                 an RPC server listening only on TCP. -->
                            <!-- <serverTcpOnly>true</serverTcpOnly> -->
                            <!-- Uncomment the following line to create
                                 an RPC server listening only on UDP. -->
                            <!-- <serverUdpOnly>true</serverUdpOnly> -->
                        </configuration>
                    </execution>
                    <execution>
                        <id>jrpcgen.mount</id>
                        <goals>
                            <goal>client</goal>
                        </goals>
                        <configuration>
                            <xFile>src/main/rpc/mount.x</xFile>
                            <destDir>${project.build.directory}/generated-sources/remotetea</destDir>
                            <packageName>org.deepsymmetry.cratedigger.rpc</packageName>
                            <createDir>true</createDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!--
               The remote tea plugin does not automatically add its own generated sources to the source scope.
               It also seems that when compiling with ksc version 0.9, neither does the Kaitai Struct plugin.
             -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/remotetea</source>
                                <source>${project.build.directory}/generated-sources/kaitai</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.2.2</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>11</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>

            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>11</release>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <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-source-plugin</artifactId>
                <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>
                <configuration>
                    <release>8</release>
                    <additionalOptions>-html5</additionalOptions>
                    <additionalJOption>--no-module-directories</additionalJOption>
                    <!-- The generated code causes tons of linting errors, alas! -->
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                    <additionalJOption>--allow-script-in-comments</additionalJOption>
                    <header>
                      <![CDATA[
                               <!-- Google tag (gtag.js) -->
                               <script async src="https://www.googletagmanager.com/gtag/js?id=G-RF9JED08L1"></script>
                               <script>
                               window.dataLayer = window.dataLayer || [];
                               function gtag(){dataLayer.push(arguments);}
                               gtag('js', new Date());

                               gtag('config', 'G-RF9JED08L1');
                               </script>
                      ]]>
                    </header>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-help-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
        </plugins>
    </reporting>

    <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>
</project>
