<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.igniterealtime.openfire</groupId>
    <version>5.0.0-SNAPSHOT</version>
    <artifactId>plugins</artifactId>
    <packaging>pom</packaging>
    <name>Openfire Plugins</name>

    <description>Parent POM for Openfire plugins.</description>
    <url>http://www.igniterealtime.org/projects/openfire/</url>

    <inceptionYear>2003</inceptionYear>

    <issueManagement>
        <system>jira</system>
        <url>https://igniterealtime.atlassian.net/browse/OF</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/igniterealtime/Openfire.git</connection>
        <developerConnection>scm:git:https://github.com/igniterealtime/Openfire.git</developerConnection>
        <url>https://github.com/igniterealtime/Openfire</url>
    </scm>

    <developers>
        <developer>
            <name>Guus der Kinderen</name>
            <roles>
                <role>Lead Developer</role>
            </roles>
            <email>guus.der.kinderen@gmail.com</email>
            <timezone>+1</timezone>
            <organization>Ignite Realtime</organization>
            <organizationUrl>http://www.igniterealtime.org</organizationUrl>
        </developer>
        <developer>
            <name>Robin Collier</name>
            <roles>
                <role>Developer</role>
            </roles>
            <email>robincollier@hotmail.com</email>
            <timezone>-5</timezone>
            <organization>Ignite Realtime</organization>
            <organizationUrl>http://www.igniterealtime.org</organizationUrl>
        </developer>
        <developer>
            <name>Matt Tucker</name>
            <roles>
                <role>Original Author</role>
                <role>Developer (inactive)</role>
            </roles>
            <email>matt@jivesoftware.com</email>
            <organization>Jive Software</organization>
            <organizationUrl>http://www.jivesoftware.com</organizationUrl>
            <timezone>-8</timezone>
        </developer>
        <developer>
            <name>Gaston Dombiak</name>
            <roles>
                <role>Original Author</role>
                <role>Lead Developer (inactive)</role>
            </roles>
            <email>gaston@jivesoftware.com</email>
            <organization>Jive Software</organization>
            <organizationUrl>http://www.jivesoftware.com</organizationUrl>
            <timezone>-8</timezone>
        </developer>
        <developer>
            <name>Daniel Henninger</name>
            <roles>
                <role>Developer (inactive)</role>
            </roles>
            <email>daniel@vorpalcloud.org</email>
            <timezone>-5</timezone>
            <organization>Ignite Realtime</organization>
            <organizationUrl>http://www.igniterealtime.org</organizationUrl>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>Daryl Herzmann</name>
            <roles>
                <role>Community Organizer</role>
            </roles>
            <email>akrherz@iastate.edu</email>
            <organization>Iowa State University</organization>
            <organizationUrl>http://mesonet.agron.iastate.edu</organizationUrl>
            <timezone>-6</timezone>
        </contributor>
    </contributors>

    <modules>
        <module>openfire-plugin-assembly-descriptor</module>
    </modules>

    <organization>
        <name>Ignite Realtime</name>
        <url>https://www.igniterealtime.org</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Use static build timestamp for reproducible builds -->
        <project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>

        <!-- The name of the Openfire plugin (defaults to ${project.artifactId}. This value is somewhat particular:
           - * It is used as a Java package name (and thus, cannot contain characters like dashes and dots.
           - * It is also used as a file name for the resulting Openfire plugin.
           - * Finally, it is used to identify resources, such as i18n files.
           - Least issues will occur when this value is all lowercase, simple ASCII text.
           -->
        <plugin.name>${project.artifactId}</plugin.name>

        <!-- Versions -->
        <openfire.version>5.0.0-SNAPSHOT</openfire.version>
        <!-- Note; the following jetty.version should be identical to the jetty.version in xmppserver/pom.xml -->
        <jetty.version>12.0.21</jetty.version>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <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.5.0</version>
                        <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>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-no-snapshots</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.5.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <rules>
                        <requireReleaseDeps>
                            <message>No Snapshots Allowed!</message>
                            <onlyWhenRelease>true</onlyWhenRelease>
                        </requireReleaseDeps>
                    </rules>
                    <fail>true</fail>
                </configuration>
            </plugin>
            <!--
            The various MINA dependencies rely on OSGi bundle artifacts rather than standard JAR files.
            As such, it's necessary to add support for these bundle to Maven using the Apache Felix maven-bundle-plugin.
            See https://stackoverflow.com/a/5409602 for a good explanation of OSGi bundles, with links to more info.
            -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>4.2.0</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <source>17</source>
                        <target>17</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <!-- Don't add Created-By and Build-Jdk-Spec fields to manifest for reproducible builds -->
                                <addDefaultEntries>false</addDefaultEntries>
                            </manifest>
                        </archive>
                        <excludes>
                            <exclude>**/*_jsp.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.igniterealtime.openfire.plugins</groupId>
                            <artifactId>openfire-plugin-assembly-descriptor</artifactId>
                            <version>${openfire.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <appendAssemblyId>true</appendAssemblyId>
                                <finalName>${plugin.name}</finalName>
                                <attach>true</attach>
                                <!-- This is where we use our shared assembly descriptor -->
                                <descriptorRefs>
                                    <descriptorRef>openfire-plugin-assembly</descriptorRef>
                                </descriptorRefs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Compile the JSP pages -->
                <plugin>
                    <groupId>org.eclipse.jetty.ee8</groupId>
                    <artifactId>jetty-ee8-jspc-maven-plugin</artifactId>
                    <version>${jetty.version}</version>
                    <configuration>
                        <webAppSourceDirectory>${project.build.sourceDirectory}/../web</webAppSourceDirectory>
                        <webXml>${project.build.sourceDirectory}/../web/WEB-INF/web.xml</webXml>
                    </configuration>
                    <executions>
                        <execution>
                            <id>jspc</id>
                            <goals>
                                <goal>jspc</goal>
                            </goals>
                            <configuration>
                                <useProvidedScope>true</useProvidedScope>
                                <jspc>
                                    <package>org.jivesoftware.openfire.plugin.${plugin.name}</package>
                                </jspc>
                                <sourceVersion>17</sourceVersion>
                                <targetVersion>17</targetVersion>
                                <keepSources>true</keepSources>
                                <scanManifest>false</scanManifest>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.eclipse.jetty.ee8</groupId>
                            <artifactId>jetty-ee8-glassfish-jstl</artifactId>
                            <version>${jetty.version}</version>
                            <exclusions>
                                <exclusion> <!-- The exclusion of Xalan is no longer needed when Jetty bug https://github.com/jetty/jetty.project/issues/12674 is fixed. The fix is expected to be part of Jetty release 12.0.17. -->
                                    <groupId>xalan</groupId>
                                    <artifactId>xalan</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                    </dependencies>
                </plugin>

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

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

            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.igniterealtime.openfire</groupId>
            <artifactId>xmppserver</artifactId>
            <version>${openfire.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.igniterealtime.openfire</groupId>
            <artifactId>xmppserver</artifactId>
            <version>${openfire.version}</version>
            <classifier>taglib</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <!-- Repository in which we deploy this project, when desired. -->
        <repository>
            <id>igniterealtime</id>
            <name>Ignite Realtime Repository</name>
            <url>https://igniterealtime.org/archiva/repository/maven/</url>
        </repository>
    </distributionManagement>

    <repositories>
        <!-- Where we obtain dependencies. -->
        <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 used by this project from. This
             apparently is also used to obtain the dependencies _used by_ plugins
             (eg: openfire-plugin-assembly-descriptor) -->
        <pluginRepository>
            <id>igniterealtime</id>
            <name>Ignite Realtime Repository</name>
            <url>https://igniterealtime.org/archiva/repository/maven/</url>
        </pluginRepository>
    </pluginRepositories>
</project>
