<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>
    <parent>
        <artifactId>plugins</artifactId>
        <groupId>org.igniterealtime.openfire</groupId>
        <version>5.2.0-SNAPSHOT</version>
    </parent>
    <groupId>org.igniterealtime.openfire.plugins</groupId>
    <artifactId>monitoring</artifactId>
    <version>2.8.1-SNAPSHOT</version>
    <name>Monitoring Plugin</name>
    <description>Monitors conversations and statistics of the server.</description>

    <properties>
        <jersey.version>2.45</jersey.version>
    </properties>

    <build>
        <sourceDirectory>src/java</sourceDirectory>
        <plugins>
            <!--
                Fetches the Noto Sans CJK font used by PdfReportWriter to render CJK text in PDF exports,
                rather than committing a ~16MB binary to the repository. Pinned by URL and sha256 for
                reproducibility. See src/web/fonts/LICENSE-NotoSansCJK.txt for licensing (SIL OFL 1.1).
            -->
            <plugin>
                <groupId>io.github.download-maven-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <version>2.1.0</version>
                <executions>
                    <execution>
                        <id>download-noto-sans-cjk</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/08_NotoSansCJKsc.zip</url>
                            <sha256>a927e56f53bd6c3b920bc139c0b94aa36c7d9ad0cf009b159437a1a003581140</sha256>
                            <outputDirectory>${project.build.directory}/font-download</outputDirectory>
                            <outputFileName>NotoSansCJKsc.zip</outputFileName>
                            <overwrite>false</overwrite>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>unpack-noto-sans-cjk</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <mkdir dir="${project.basedir}/src/web/fonts"/>
                                <unzip src="${project.build.directory}/font-download/NotoSansCJKsc.zip"
                                       dest="${project.basedir}/src/web/fonts">
                                    <patternset>
                                        <include name="NotoSansCJKsc-Regular.otf"/>
                                    </patternset>
                                </unzip>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>custom-test-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classesDirectory>${project.build.testOutputDirectory}</classesDirectory>
                            <classifier>integration-tests</classifier>
                            <finalName>${project.artifactId}</finalName>
                            <includes>
                                <include>org/jivesoftware/smackx/muc/**</include>
                                <include>org/jivesoftware/smackx/mam/**</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
            </plugin>
            <!-- Compiles the Openfire Admin Console JSP pages. -->
            <plugin>
                <groupId>org.eclipse.jetty.ee8</groupId>
                <artifactId>jetty-ee8-jspc-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-jetty-servlet</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>com.purej</groupId>
            <artifactId>jrobin</artifactId>
            <version>1.7.1</version>
        </dependency>
        <dependency>
            <groupId>jfree</groupId>
            <artifactId>jfreechart</artifactId>
            <version>1.0.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>8.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
            <version>8.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>3.0.7</version>
        </dependency>
        <dependency>
            <groupId>de.rototor.pdfbox</groupId>
            <artifactId>graphics2d</artifactId>
            <version>3.0.3</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.16.1</version>
        </dependency>
        <!-- Provides javax.annotation.Nullable/Nonnull -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>

        <!-- For java 9+, see: https://stackoverflow.com/questions/51916221 -->
        <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/javax.activation/activation -->
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.3</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.igniterealtime.smack</groupId>
            <artifactId>smack-integration-test</artifactId>
            <version>4.6.0-alpha1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <!-- Where dependencies are obtained (such as the parent project). -->
        <repository>
            <id>igniterealtime</id>
            <name>Ignite Realtime Repository</name>
            <url>https://igniterealtime.org/archiva/repository/maven/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <!-- Typically used to retrieve Maven plugins that are used by this project.
             This apparently is also used to botain the dependencies _used by_ these
             plugins (such as the openfire-plugin-assembly-descriptor, needed to
             package the project as an Openfire plugin!) -->
        <pluginRepository>
            <id>igniterealtime</id>
            <name>Ignite Realtime Repository</name>
            <url>https://igniterealtime.org/archiva/repository/maven/</url>
        </pluginRepository>
    </pluginRepositories>
</project>
