<?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.kie</groupId>
    <artifactId>drools-build-parent</artifactId>
    <version>8.29.0.Final</version>
    <relativePath>../build-parent/pom.xml</relativePath>
  </parent>

  <artifactId>efesto</artifactId>
  <packaging>pom</packaging>
  <name>Efesto</name>
  <description>New model container framework</description>

  <properties>
    <rewrite.maven.plugin.version>4.23.0</rewrite.maven.plugin.version>
    <rewrite.testing.frameworks.version>1.22.0</rewrite.testing.frameworks.version>
    <archunit.maven.plugin.version>2.9.1</archunit.maven.plugin.version>
    <jdepend.maven.plugin.version>2.0</jdepend.maven.plugin.version>
    <skip.jdepend>true</skip.jdepend>
  </properties>

  <modules>
    <module>efesto-core</module>
    <module>efesto-dependencies</module>
    <module>efesto-common-utils</module>
  </modules>

  <!-- Dependencies core to all modules. Keep that as limited as possible. Please avoid indirect or looped dependencies-->
  <dependencies>
    <!-- External -->
    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>
    <!-- Test -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.openrewrite.maven</groupId>
          <artifactId>rewrite-maven-plugin</artifactId>
          <version>${rewrite.maven.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.societegenerale.commons</groupId>
          <artifactId>arch-unit-maven-plugin</artifactId>
          <version>${archunit.maven.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>jdepend-maven-plugin</artifactId>
          <version>${jdepend.maven.plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/Test*.java</include>
            <include>**/*Test.java</include>
            <include>**/*Tests.java</include>
          </includes>
          <excludes>
            <exclude>**/*IntegrationTest.java</exclude>
          </excludes>
          <argLine>-Xmx1024m -Dfile.encoding=UTF-8</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.openrewrite.maven</groupId>
        <artifactId>rewrite-maven-plugin</artifactId>
        <configuration>
          <activeRecipes>
            <recipe>org.openrewrite.java.testing.junit5.JUnit4to5Migration</recipe>
            <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>
            <recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe>
            <recipe>org.openrewrite.java.testing.junit5.StaticImports</recipe>
          </activeRecipes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-testing-frameworks</artifactId>
            <version>${rewrite.testing.frameworks.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>com.societegenerale.commons</groupId>
        <artifactId>arch-unit-maven-plugin</artifactId>
        <configuration>

          <!--  optional - you can avoid build fail if there is issue. True to avoid build failure, default is false -->
          <!--  <noFailOnError>true</noFailOnError>-->

          <!--  optional - you can exclude classes that have a path containing any of the mentioned paths -->
          <!--  <excludedPaths>-->
          <!--    <excludedPath>my/package/to/exclude</excludedPath>-->
          <!--  </excludedPaths>-->
          <noFailOnError>true</noFailOnError>

          <rules>
            <!-- using a rule available out of the box... -->
            <preConfiguredRules>
              <rule>com.societegenerale.commons.plugin.rules.NoJunitAssertRuleTest</rule>
            </preConfiguredRules>
          </rules>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>arch-test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <configuration>
          <skip>${skip.jdepend}</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
