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

  <parent>
    <groupId>org.operaton.bpm.dmn</groupId>
    <artifactId>operaton-engine-dmn-root</artifactId>
    <version>1.0.3</version>
  </parent>

  <artifactId>operaton-engine-dmn</artifactId>
  <name>Operaton - DMN - Engine</name>
  <description>${project.name}</description>
  <properties>
    <operaton.artifact>org.operaton.bpm.dmn.engine</operaton.artifact>
    <operaton.osgi.import.additional>
      org.junit.*;resolution:=optional
    </operaton.osgi.import.additional>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.operaton.commons</groupId>
      <artifactId>operaton-commons-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.operaton.commons</groupId>
      <artifactId>operaton-commons-typed-values</artifactId>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm.model</groupId>
      <artifactId>operaton-dmn-model</artifactId>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm.dmn</groupId>
      <artifactId>operaton-engine-feel-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm.dmn</groupId>
      <artifactId>operaton-engine-feel-juel</artifactId>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm.dmn</groupId>
      <artifactId>operaton-engine-feel-scala</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.feel</groupId>
      <artifactId>feel-engine</artifactId>
      <classifier>scala-shaded</classifier>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm.juel</groupId>
      <artifactId>operaton-juel</artifactId>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.groovy</groupId>
      <artifactId>groovy-jsr223</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.graalvm.polyglot</groupId>
      <artifactId>js</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js-scriptengine</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.operaton.bpm</groupId>
      <artifactId>operaton-bpm-archunit</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/junit-shared</source>
                <source>src/main/junit4</source>
                <source>src/main/junit5</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/junit4</source>
                <source>src/test/junit5</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
          <execution>
            <id>junit4-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>junit4</classifier>
              <classesDirectory>${project.build.directory}/classes-junit4</classesDirectory>
            </configuration>
          </execution>
          <execution>
            <id>junit5-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>junit5</classifier>
              <classesDirectory>${project.build.directory}/classes-junit5</classesDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
          <!-- Additional execution to compile code needed for JUnit4 test only -->
          <execution>
            <id>junit4-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <!-- Specify the extra test source folder -->
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/junit-shared</compileSourceRoot>
                <compileSourceRoot>${project.basedir}/src/main/junit4</compileSourceRoot>
              </compileSourceRoots>
              <!-- Set its own output directory -->
              <outputDirectory>${project.build.directory}/classes-junit4</outputDirectory>
            </configuration>
          </execution>
          <!-- Additional execution to compile code needed for JUnit5 test only -->
          <execution>
            <id>junit5-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <!-- Specify the extra test source folder -->
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/junit-shared</compileSourceRoot>
                <compileSourceRoot>${project.basedir}/src/main/junit5</compileSourceRoot>
              </compileSourceRoots>
              <!-- Set its own output directory -->
              <outputDirectory>${project.build.directory}/classes-junit5</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <dependenciesToScan>
            <dependency>org.operaton.bpm:operaton-bpm-archunit</dependency>
          </dependenciesToScan>
        </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>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- check for api differences between latest minor release -->
    <profile>
      <id>check-api-compatibility</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>clirr-maven-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>org/operaton/bpm/dmn/engine/impl/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <id>restrictive</id>
                <configuration>
                  <ignoredDifferencesFile>../.clirr-ignore.xml</ignoredDifferencesFile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
