<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>fmj</artifactId>
  <version>1.0.2-jitsi</version>
  <packaging>bundle</packaging>

  <name>fmj</name>
  <description>Freedom for Media in Java</description>
  <url>https://github.com/jitsi/fmj/</url>

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

  <licenses>
    <license>
      <name>LGPL-2.1-or-later</name>
      <url>https://spdx.org/licenses/LGPL-2.1-or-later.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

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

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <!-- test -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>../../src</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>5.1.1</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Fragment-Host>org.jitsi.libjitsi</Fragment-Host>
            <_noclassforname>true</_noclassforname>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <compilerArgs>
            <arg>-Xlint:all,-serial</arg>
          </compilerArgs>
          <excludes>
            <exclude>**/civil/**</exclude>
            <exclude>net/sf/fmj/capture/**</exclude>
            <exclude>net/sf/fmj/ds/**</exclude>
            <exclude>net/sf/fmj/ejmf/toolkit/gui/**</exclude>
            <exclude>net/sf/fmj/gui/**</exclude>
            <exclude>net/sf/fmj/media/cdp/GlobalCaptureDevicePlugger.java</exclude>
            <exclude>net/sf/fmj/qt/**</exclude>
            <exclude>net/sf/fmj/test/**</exclude>
            <exclude>net/sf/jdshow/**</exclude>
            <!-- src.apps -->
            <exclude>fi/iki/elonen/nanohttpd/**</exclude>
            <exclude>net/sf/fmj/apps/**</exclude>
            <!-- src.ffmpeg-java -->
            <exclude>net/sf/fmj/ffmpeg_java/**</exclude>
            <!-- src.fmjstudio -->
            <exclude>net/sf/fmj/ui/**</exclude>
            <!-- src.gst -->
            <exclude>net/sf/fmj/gst/**</exclude>
            <!-- src.sip-communicator -->
            <exclude>net/java/**</exclude>
            <!-- src.theora-java -->
            <exclude>net/sf/fmj/theora_java/**</exclude>
          </excludes>
        </configuration>
      </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.2.0</version>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.0.0-M1</version>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>../../src.capture</source>
                <source>../../src.ejmf</source>
                <source>../../src.rtp</source>
                <source>../../src.stubs</source>
                <source>../../src.sunibm.base</source>
                <source>../../src.sunibm.replace</source>
                <source>../../src.t4l</source>
                <source>../../src.utils</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </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>
  </build>
  
  <profiles>
    <profile>
      <id>release-central</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <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>
            <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>
