<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>libjitsi</artifactId>
  <version>1.1-4-gfb6b03ff</version>
  <packaging>bundle</packaging>

  <name>libjitsi</name>
  <description>
    libjitsi is an advanced Java media library for secure real-time audio/video
    communication
  </description>
  <url>https://github.com/jitsi/libjitsi</url>

  <organization>
    <name>jitsi.org</name>
    <url>https://jitsi.org</url>
  </organization>

  <developers>
    <developer>
      <id>org.jitsi</id>
      <name>Jitsi Team</name>
      <email>dev@jitsi.org</email>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/jitsi/libjitsi</url>
    <connection>scm:git:https://github.com/jitsi/libjitsi.git</connection>
    <developerConnection>scm:git:https://github.com/jitsi/libjitsi.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://github.com/jitsi/libjitsi/blob/master/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <bouncycastle.version>1.69</bouncycastle.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>ch.imvs</groupId>
      <artifactId>sdes4j</artifactId>
      <version>1.1.5</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1.1</version>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>5.9.0</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk15on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk15on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bctls-jdk15on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>fmj</artifactId>
      <version>1.0.2-jitsi</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jitsi-utils</artifactId>
      <version>1.0-108-g480acf0</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jitsi-srtp</artifactId>
      <version>1.1-4-gc42f998</version>
    </dependency>
    <dependency>
      <groupId>org.opentelecoms.sdp</groupId>
      <artifactId>java-sdp-nist-bridge</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jitsi-lgpl-dependencies</artifactId>
      <version>1.2-13-gf6771c4</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>zrtp4j-light</artifactId>
      <version>4.1.2</version>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi.core</artifactId>
      <version>8.0.0</version>
      <scope>provided</scope>
    </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>
      <scope>provided</scope>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>4.0.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.pkts</groupId>
        <artifactId>pkts-core</artifactId>
        <version>3.0.10</version>
        <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <version>5.1.2</version>
         <extensions>true</extensions>
         <configuration>
            <excludeDependencies>jitsi-lgpl-dependencies</excludeDependencies>
            <instructions>
               <_noclassforname>true</_noclassforname> 
               <Import-Package>*,sun.awt.X11,sun.lwawt,sun.lwawt.macosx</Import-Package>
               <Export-Package>org.jitsi.util.*,
               org.jitsi.service.*,
               org.jitsi.sctp4j.*,
               org.jitsi.impl.neomedia,
               org.jitsi.impl.neomedia.codec,
               org.jitsi.impl.neomedia.codec.video.h264,
               org.jitsi.impl.neomedia.device,
               org.jitsi.impl.neomedia.format,
               org.jitsi.impl.neomedia.recording
               </Export-Package>
               <Private-Package>org.jitsi.examples.*,org.jitsi.impl.*</Private-Package>
               <Bundle-Activator>org.jitsi.service.libjitsi.LibJitsiActivator</Bundle-Activator>
               <Bundle-NativeCode>
                   darwin/libjnawtrenderer.dylib;
                   darwin/libjnmaccoreaudio.dylib;
                   darwin/libjnopus.dylib;
                   darwin/libjnportaudio.dylib;
                   darwin/libjnquicktime.dylib;
                   darwin/libjnscreencapture.dylib;
                   darwin/libjnspeex.dylib;
                   darwin/libjnvpx.dylib;osname=Mac OS X;processor=x86-64,
                   linux-x86/libjnawtrenderer.so;
                   linux-x86/libjnopus.so;
                   linux-x86/libjnportaudio.so;
                   linux-x86/libjnpulseaudio.so;
                   linux-x86/libjnscreencapture.so;
                   linux-x86/libjnspeex.so;
                   linux-x86/libjnvideo4linux2.so;osname=Linux;processor=x86,
                   linux-x86_64/libjnawtrenderer.so;
                   linux-x86_64/libjnopus.so;
                   linux-x86_64/libjnportaudio.so;
                   linux-x86_64/libjnpulseaudio.so;
                   linux-x86_64/libjnscreencapture.so;
                   linux-x86_64/libjnspeex.so;
                   linux-x86_64/libjnvideo4linux2.so;
                   linux-x86_64/libjnvpx.so;osname=Linux;processor=x86-64,
                   linux-aarch64/libjnawtrenderer.so;
                   linux-aarch64/libjnopus.so;
                   linux-aarch64/libjnportaudio.so;
                   linux-aarch64/libjnpulseaudio.so;
                   linux-aarch64/libjnscreencapture.so;
                   linux-aarch64/libjnspeex.so;
                   linux-aarch64/libjnvideo4linux2.so;
                   linux-aarch64/libjnvpx.so;osname=Linux;processor=AArch64,
                   linux-ppc64le/libjnawtrenderer.so;
                   linux-ppc64le/libjnopus.so;
                   linux-ppc64le/libjnportaudio.so;
                   linux-ppc64le/libjnpulseaudio.so;
                   linux-ppc64le/libjnscreencapture.so;
                   linux-ppc64le/libjnspeex.so;
                   linux-ppc64le/libjnvideo4linux2.so;osname=Linux;processor=PowerPC-64-LE,
                   win32-x86/jnawtrenderer.dll;
                   win32-x86/jndirectshow.dll;
                   win32-x86/jnopus.dll;
                   win32-x86/jnportaudio.dll;
                   win32-x86/jnscreencapture.dll;
                   win32-x86/jnspeex.dll;
                   win32-x86/jnvpx.dll;
                   win32-x86/jnwasapi.dll;osname=Win32;processor=x86,
                   win32-x86-64/jnawtrenderer.dll;
                   win32-x86-64/jndirectshow.dll;
                   win32-x86-64/jnopus.dll;
                   win32-x86-64/jnportaudio.dll;
                   win32-x86-64/jnscreencapture.dll;
                   win32-x86-64/jnspeex.dll;
                   win32-x86-64/jnvpx.dll;
                   win32-x86-64/jnwasapi.dll;
                   win32-x86-64/jnwincoreaudio.dll;osname=Win32;processor=x86-64
               </Bundle-NativeCode>
              <Bundle-License>
                Apache-2.0;link="https://github.com/jitsi/libjitsi/raw/master/LICENSE"
              </Bundle-License>
              <_removeheaders>Bnd-*, Tool, Require-Capability, Include-Resource
              </_removeheaders>
              <Include-Resource>
                {maven-resources},
                META-INF/LICENSE=LICENSE
              </Include-Resource>
            </instructions>
         </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <compilerArgs>
                    <arg>-Xlint:all</arg>
                    <arg>-h</arg>
                    <arg>${project.build.directory}/native/javah/</arg>
                </compilerArgs>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.3.1</version>
          <configuration>
            <doclint>-missing</doclint>
            <source>8</source>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
          <configuration>
            <excludeResources>true</excludeResources>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>lib/native</directory>
      </resource>
    </resources>
  </build>
  
  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>release</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <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>
