<?xml version="1.0"?>
<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.jitsi</groupId>
  <artifactId>jitsi-xmpp-extensions</artifactId>
  <version>1.0-126-g0ca2e0a</version>
  <packaging>bundle</packaging>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Make sure this matches the version of the jxmpp artifacts inherited from smack. -->
    <jxmpp.version>1.0.3</jxmpp.version>
    <smack.version>4.4.8-jitsi-4</smack.version>
    <junit.version>5.14.4</junit.version>
    <junit.platform.version>1.14.4</junit.platform.version>
    <kotlin.version>2.4.20</kotlin.version>
    <kotest.version>5.9.1</kotest.version>
    <ktlint.version>1.8.0</ktlint.version>
  </properties>
  <name>jitsi-xmpp-extensions</name>
  <description>Smack extensions used in Jitsi projects</description>
  <url>https://github.com/jitsi/jitsi-xmpp-extensions</url>
  <developers>
    <developer>
      <id>org.jitsi</id>
      <name>Jitsi Team</name>
      <email>dev@jitsi.org</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://github.com/jitsi/jitsi-xmpp-extensions/blob/master/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <url>https://github.com/jitsi/jitsi-xmpp-extensions</url>
    <connection>scm:git:https://github.com/jitsi/jitsi-xmpp-extensions.git</connection>
    <developerConnection>scm:git:https://github.com/jitsi/jitsi-xmpp-extensions.git</developerConnection>
  </scm>
  <dependencies>
    <dependency>
      <groupId>org.igniterealtime.smack</groupId>
      <artifactId>smack-core</artifactId>
      <version>${smack.version}</version>
    </dependency>
    <dependency>
      <groupId>org.igniterealtime.smack</groupId>
      <!-- It appears that smack-core needs the base64 encoder to be set,
           and this fails to happen unless we include smack-java8.  -->
      <artifactId>smack-java8</artifactId>
      <version>${smack.version}</version>
    </dependency>
    <dependency>
      <groupId>org.igniterealtime.smack</groupId>
      <artifactId>smack-extensions</artifactId>
      <version>${smack.version}</version>
    </dependency>
    <dependency>
      <groupId>org.igniterealtime.smack</groupId>
      <!-- Similarly, smack-core needs the xmlparser to be set,
           and this fails to happen unless we include smack-xmlparser-stax.  -->
      <artifactId>smack-xmlparser-stax</artifactId>
      <version>${smack.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jxmpp</groupId>
      <artifactId>jxmpp-stringprep-rocksxmppprecis</artifactId>
      <version>${jxmpp.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jitsi</groupId>
      <artifactId>jitsi-utils</artifactId>
      <version>1.0-153-gd5c0102</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.19.0</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-kotlin</artifactId>
      <version>2.19.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
      <version>23.0.0</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-reflect</artifactId>
      <version>${kotlin.version}</version>
    </dependency>
    <!-- test -->
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <version>${junit.platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-core</artifactId>
      <version>2.9.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.10.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.kotest</groupId>
      <artifactId>kotest-runner-junit5-jvm</artifactId>
      <version>${kotest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.kotest</groupId>
      <artifactId>kotest-assertions-core-jvm</artifactId>
      <version>${kotest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.kotest</groupId>
      <artifactId>kotest-assertions-json-jvm</artifactId>
      <version>${kotest.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <sourceDirs>
                <source>src/main/kotlin</source>
                <source>src/main/java</source>
              </sourceDirs>
            </configuration>
          </execution>
          <execution>
            <id>test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>test-compile</goal>
            </goals>
            <configuration>
              <sourceDirs>
                <source>src/test/kotlin</source>
                <source>src/test/java</source>
              </sourceDirs>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <jvmTarget>11</jvmTarget>
        </configuration>
      </plugin>
      <!-- ktlint: check runs in the verify phase; auto-format with "mvn exec:exec@ktlint-format" -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.6.3</version>
        <dependencies>
          <dependency>
            <groupId>com.pinterest.ktlint</groupId>
            <artifactId>ktlint-cli</artifactId>
            <version>${ktlint.version}</version>
            <classifier>all</classifier>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>ktlint-check</id>
            <phase>verify</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <includePluginDependencies>true</includePluginDependencies>
              <arguments>
                <argument>-classpath</argument>
                <classpath>
                  <dependency>com.pinterest.ktlint:ktlint-cli</dependency>
                </classpath>
                <argument>com.pinterest.ktlint.Main</argument>
                <argument>--relative</argument>
                <argument>src/main/kotlin/**/*.kt</argument>
                <argument>src/test/kotlin/**/*.kt</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>ktlint-format</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <includePluginDependencies>true</includePluginDependencies>
              <arguments>
                <argument>-classpath</argument>
                <classpath>
                  <dependency>com.pinterest.ktlint:ktlint-cli</dependency>
                </classpath>
                <argument>com.pinterest.ktlint.Main</argument>
                <argument>--format</argument>
                <argument>--relative</argument>
                <argument>src/main/kotlin/**/*.kt</argument>
                <argument>src/test/kotlin/**/*.kt</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M6</version>
        <configuration>
          <systemPropertyVariables>
            <kotest.framework.classpath.scanning.autoscan.disable>true</kotest.framework.classpath.scanning.autoscan.disable>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <executions>
          <!-- Replacing default-compile as it is treated specially by maven -->
          <execution>
            <id>default-compile</id>
            <phase>none</phase>
          </execution>
          <!-- Replacing default-testCompile as it is treated specially by maven -->
          <execution>
            <id>default-testCompile</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>java-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>java-test-compile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <release>11</release>
          <compilerArgs>
            <arg>-Xlint:all</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>5.1.6</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/kotlin</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.0</version>
        <configuration>
          <doclint>-missing</doclint>
          <source>11</source>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.0.0-M2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.2</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>10.1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.7.0</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>jitsi-maven-repository-releases</id>
      <layout>default</layout>
      <name>Jitsi Maven Repository (Releases)</name>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <url>https://github.com/jitsi/jitsi-maven-repository/raw/master/releases/</url>
    </repository>
    <repository>
      <id>jitsi-maven-repository-snapshots</id>
      <layout>default</layout>
      <name>Jitsi Maven Repository (Snapshots)</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://github.com/jitsi/jitsi-maven-repository/raw/master/snapshots/</url>
    </repository>
  </repositories>
  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>release</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/main/kotlin</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <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>
