<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-api</artifactId>
  <version>2.6.1.Final</version>
  <name>cache2k API</name>

  <description>
    A light weight and high performance Java caching library. Android and Java 6 compatible.
    This artifact contains the official API of cache2k.
  </description>

  <dependencies>

    <!-- https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
    </dependency>
    <!-- Required for @NonNullApi support -->
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-annotations-jvm</artifactId>
      <version>1.6.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>

      <!-- print a clirr report with:  mvn clirr:check -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>clirr-maven-plugin</artifactId>
        <version>2.6.1</version>
        <configuration>
          <comparisonArtifacts>
            <comparisonArtifact>
              <groupId>org.cache2k</groupId>
              <artifactId>cache2k-api</artifactId>
              <version>1.0.0.Final</version>
            </comparisonArtifact>
          </comparisonArtifacts>
        </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>osgi-bundle</id>
            <phase>package</phase>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>
              org.cache2k,
              org.cache2k.spi,
              org.cache2k.integration,
              org.cache2k.io,
              org.cache2k.expiry,
              org.cache2k.event,
              org.cache2k.processor,
              org.cache2k.config
            </Export-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>
            <jpms-module-info>org.cache2k.api</jpms-module-info>
          </instructions>
          <niceManifest>true</niceManifest>
        </configuration>
      </plugin>
      -->
    </plugins>
  </build>

<profiles>
  <profile>
    <id>CheckerFramework</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <annotationProcessorPaths>
              <!-- https://checkerframework.org/manual/#maven -->
              <path>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker</artifactId>
                <version>3.7.1</version>
              </path>
            </annotationProcessorPaths>
            <annotationProcessors>
              <!-- Add all the checkers you want to enable here -->
              <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
            </annotationProcessors>
          </configuration>
        </plugin>
      </plugins>
    </build>
    <!-- Unfortunately, checker framework needs this dependency -->
    <dependencies>
      <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>checker</artifactId>
        <version>3.7.1</version>
      </dependency>
    </dependencies>
  </profile>
</profiles>

</project>
