<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>4.5.1-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>http://issues.igniterealtime.org/browse/OF</url>
    </issueManagement>

    <scm>
        <connection>scm:svn:http://svn.igniterealtime.org/svn/repos/openfire/trunk/</connection>
        <developerConnection>scm:svn:https://svn.igniterealtime.org/svn/repos/openfire/trunk/</developerConnection>
        <url>http://fisheye.igniterealtime.org/viewrep/openfire/trunk/</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>

        <!-- 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>4.5.1-SNAPSHOT</openfire.version>
        <!-- Note; the following jetty.version should be identical to the jetty.version in xmppserver/pom.xml -->
        <jetty.version>9.4.18.v20190429</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.1.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>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <!--
                    Java has trouble reading translations from UTF-8 files. To work around that,
                    this plugin copies the i18n files from source to the build directory, to be
                    modified later by the native2ascii-maven-plugin.
                  -->
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/i18n/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.sourceDirectory}/../i18n/</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!--
                    Java has trouble reading translations from UTF-8 files. To work around that,
                    this plugin ensures that Java-compatible encoding is used.
                    See https://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle
                  -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native2ascii-maven-plugin</artifactId>
                <version>2.0.1</version>
                <executions>
                    <execution>
                        <id>utf8-to-latin1</id>
                        <goals>
                            <goal>inplace</goal>
                        </goals>
                        <configuration>
                            <dir>${project.build.directory}/i18n/</dir>
                        </configuration>
                    </execution>
                </executions>
            </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-jar-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <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</groupId>
                    <artifactId>jetty-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>1.8</sourceVersion>
                                <targetVersion>1.8</targetVersion>
                                <keepSources>true</keepSources>
                            </configuration>
                        </execution>
                    </executions>
                </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>
    </dependencies>

    <distributionManagement>
        <!-- Repository in which we deploy this project, when desired. -->
        <repository>
            <id>igniterealtime</id>
            <name>Ignite Realtime Repository</name>
            <url>https://www.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>
