<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.cache2k</groupId>
    <artifactId>cache2k-java11-parent</artifactId>
    <version>2.6.1.Final</version>
    <relativePath>../cache2k-java11-parent/pom.xml</relativePath>
  </parent>

  <artifactId>cache2k-core</artifactId>
  <version>2.6.1.Final</version>
  <name>cache2k core implementation</name>

  <description>
    A light weight and high performance Java caching library. Android and Java 6 compatible.
    This artifact contains the implementation of the core functionality of cache2k.
    For using and integrating cache2k in applications please use the definitions in the cache2k-api
    artifact only. Classes within the implementation code are not stable within releases and may
    move or even disappear.
  </description>

  <dependencies>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cache2k-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.32</version>
      <optional>true</optional>
    </dependency>
    <!--
      slf4j api is included in test scope by maven and it is the first pick.
      add simple log output to see log output.
      -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.32</version>
      <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.cache2k</groupId>
        <artifactId>cache2k-testing</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      <!-- Exclude JUnit5 to have parallel test execution with JUnit4 -->
      <exclusions>
        <exclusion>
          <groupId>org.junit.vintage</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.junit.platform</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit4.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Provides NotThreadSafe annotation, used for sure fire -->
    <dependency>
        <groupId>net.jcip</groupId>
        <artifactId>jcip-annotations</artifactId>
        <version>1.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cache2k-schema</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
      <!-- Filtering adds the version, buildNumber and timestamp to org.cache2k.impl.version.txt
           We use this mechanism instead of accessing the manifest, since it is working reliable on Android, too
      -->
      <resources>
          <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
          </resource>
      </resources>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <licenseName>apache_v2</licenseName>
          <excludes>
            <!-- Don't add header to XML config files. -->
            <exclude>test/resources/**</exclude>
            <!-- Don't add header to property files, safe space -->
            <exclude>**/*.properties</exclude>
            <!-- Don't add header to JSON, which does not support comments -->
            <exclude>**/*.json</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- add OSGi bundle information. does not work yet.
           https://github.com/cache2k/cache2k/issues/83
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Private-Package>*;-split-package:=merge-first</Private-Package>
            <Export-Package>
            </Export-Package>
            <Import-Package>
              javax.management,
              javax.naming,
              javax.xml.stream,
              org.apache.commons.logging;resolution:=optional,
              org.slf4j;resolution:=optional,
              org.cache2k,
              org.cache2k.spi,
              org.cache2k.integration,
              org.cache2k.expiry,
              org.cache2k.event,
              org.cache2k.processor,
              org.cache2k.configuration
            </Import-Package>
            <Bundle-DocURL>https://cache2k.org</Bundle-DocURL>
            <Implementation-Build>${buildNumber}</Implementation-Build>
            <Implementation-Version>${project.version}</Implementation-Version>
            <Implementation-Title>${project.name}</Implementation-Title>
            <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
            <Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
            <Provide-Capability>osgi.serviceloader; osgi.serviceloader=org.cache2k.spi.Cache2kCoreProvider</Provide-Capability>
          </instructions>
          <niceManifest>true</niceManifest>
        </configuration>
      </plugin>
      -->

    </plugins>
  </build>

</project>
