<?xml version="1.0" encoding="UTF-8"?>
<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.kie</groupId>
    <artifactId>drools-build-parent</artifactId>
    <version>8.14.1.Beta</version>
    <relativePath>../build-parent/pom.xml</relativePath>
  </parent>

  <artifactId>kie-api</artifactId>

  <name>KIE :: Public API</name>
  <description>The Drools and jBPM public API which is backwards compatible between releases.</description>

  <properties>
    <java.module.name>org.kie.api</java.module.name>
  </properties>

  <profiles>
    <profile>
      <id>apiviz-config</id>
      <activation>
        <jdk>(,10]</jdk>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <!-- Important: this doclet requires Graphviz (the 'dot' command) to be installed.
                     It logs warning if it can not find the command, but the build continues and the generated javadoc simply
                     does not contain the graphs. This is not ideal, but it's better that just failing directly as the 'dot'
                     command is not installed by default on most systems and this would put additional burden for contributors
                     to build the project. We need to make sure that our build machines do have the Graphviz installed. -->
                <doclet>org.jboss.apiviz.APIviz</doclet>
                <docletArtifact>
                  <groupId>com.grahamedgecombe.apiviz</groupId>
                  <artifactId>apiviz</artifactId>
                  <version>1.3.4</version>
                </docletArtifact>
                <source>${maven.compiler.source}</source>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <sourcepath>${project.basedir}/src/main/java</sourcepath>
          <excludePackageNames>org.kie.util*</excludePackageNames>
          <source>${maven.compiler.source}</source>
          <groups>
            <group>
              <title>KIE Base API</title>
              <packages>org.kie.api</packages>
            </group>
            <group>
              <title>Builder API</title>
              <packages>org.kie.api.builder*</packages>
            </group>
            <group>
              <title>Definition API</title>
              <packages>org.kie.api.definition*</packages>
            </group>
            <group>
              <title>Configuration API</title>
              <packages>org.kie.api.conf*</packages>
            </group>
            <group>
              <title>Runtime API</title>
              <packages>org.kie.api.runtime*</packages>
            </group>
            <group>
              <title>Commands API</title>
              <packages>org.kie.api.command*</packages>
            </group>
            <group>
              <title>Event API</title>
              <packages>org.kie.api.event*</packages>
            </group>
            <group>
              <title>Time API</title>
              <packages>org.kie.api.time*</packages>
            </group>
            <group>
              <title>Task API</title>
              <packages>org.kie.api.task*</packages>
            </group>
            <group>
              <title>CDI Support API</title>
              <packages>org.kie.api.cdi*</packages>
            </group>
          </groups>
          <useStandardDocletOptions>true</useStandardDocletOptions>
          <additionalparam>-sourceclasspath ${project.build.outputDirectory}</additionalparam>
        </configuration>
        <executions>
          <execution>
            <!-- Run the javadoc plugin also as part of the standard build (for other modules, it is executed only when -Dfull is specified).
                 Some downstream repositories (e.g. Drools) depend on this -javadoc artifact and need it even for non-full builds. -->
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.activation</groupId>
      <artifactId>jakarta.activation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>jakarta.enterprise</groupId>
      <artifactId>jakarta.enterprise.cdi-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
