<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie</groupId>
    <artifactId>drools-build-parent</artifactId>
    <version>10.1.0</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>
          </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>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>    
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
