<!--
  ~ Copyright 2017-2021 Open Networking Foundation
  ~ Copyright 2023 PANTHEON.tech, s.r.o.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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>

  <parent>
    <groupId>org.opendaylight.controller</groupId>
    <artifactId>bundle-parent</artifactId>
    <version>10.0.14</version>
    <relativePath>../bundle-parent</relativePath>
  </parent>

  <artifactId>atomix-storage</artifactId>
  <name>Atomix Storage</name>
  <packaging>bundle</packaging>

  <properties>
    <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
    <odlparent.spotbugs.enforce>false</odlparent.spotbugs.enforce>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-buffer</artifactId>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jdt</groupId>
      <artifactId>org.eclipse.jdt.annotation</artifactId>
    </dependency>
    <dependency>
      <groupId>org.opendaylight.controller</groupId>
      <artifactId>raft-journal</artifactId>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>kryo</artifactId>
      <version>4.0.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>minlog</artifactId>
      <version>1.3.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>reflectasm</artifactId>
      <version>1.11.9</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.objenesis</groupId>
      <artifactId>objenesis</artifactId>
      <version>2.6</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- This project has a different license -->
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-license</id>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-license</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy file="LICENSE" tofile="${project.build.directory}/classes/LICENSE"/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>check-license</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>
              io.atomix.storage.journal
            </Export-Package>
            <Import-Package>
              sun.nio.ch;resolution:=optional,
              sun.misc;resolution:=optional,
              !COM.newmonics.*,
              !android.os,
              *
            </Import-Package>

            <!-- Kryo is using ancient objenesis, so let's embed it to prevent duplicates -->
            <Embed-Dependency>
                *;inline=true;groupId=com.esotericsoftware,
                *;inline=true;groupId=org.objenesis,
            </Embed-Dependency>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
