<?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-92-g2d110a0</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-1</smack.version>
    <junit.version>5.10.0</junit.version>
    <kotlin.version>1.9.10</kotlin.version>
    <kotest.version>5.7.2</kotest.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-114-g43815ed</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.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</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>
      <plugin>
        <groupId>com.github.gantsign.maven</groupId>
        <artifactId>ktlint-maven-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <sourceRoots>
            <sourceRoot>${project.basedir}/src/main/kotlin</sourceRoot>
          </sourceRoots>
          <testSourceRoots>
            <testSourceRoot>${project.basedir}/src/test/kotlin</testSourceRoot>
          </testSourceRoots>
        </configuration>
        <executions>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M6</version>
      </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://oss.sonatype.org/</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>
