<?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>

  <groupId>org.smartregister</groupId>
    <artifactId>easy-rules</artifactId>
    <version>4.1.1</version>

    <modules>
        <module>easy-rules-archetype</module>
        <module>easy-rules-core</module>
        <module>easy-rules-tutorials</module>
        <module>easy-rules-mvel</module>
        <module>easy-rules-support</module>
        <module>easy-rules-spel</module>
        <module>easy-rules-jexl</module>
    </modules>

    <packaging>pom</packaging>

    <name>Easy Rules</name>
    <description>Easy Rules is a simple, stupid rules engine for Java</description>
    <url>https://github.com/opensrp/easy-rules</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>17</java.version>
        <junit.version>4.13.2</junit.version>
        <assertj.version>3.25.3</assertj.version>
        <mockito.version>5.12.0</mockito.version>
        <system-lambda.version>1.2.1</system-lambda.version>
        <slf4j.version>2.0.13</slf4j.version>
        <jackson.version>2.17.1</jackson.version>
        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
        <maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
        <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
        <maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
        <central.publishing.plugin.version>0.7.0</central.publishing.plugin.version>
        <maven-license-plugin.version>4.5</maven-license-plugin.version>
        <maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
    </properties>

    <scm>
        <url>git@github.com:opensrp/easy-rules.git</url>
        <connection>scm:git:git@github.com:opensrp/easy-rules.git</connection>
        <developerConnection>scm:git:git@github.com:opensrp/easy-rules.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/opensrp/easy-rules/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Github Actions</system>
        <url>https://github.com/opensrp/easy-rules/actions</url>
    </ciManagement>

    <developers>
        <developer>
            <id>benas</id>
            <name>Mahmoud Ben Hassine</name>
            <url>http://benas.github.io</url>
            <email>mahmoud.benhassine@icloud.com</email>
            <roles>
                <role>Lead developer</role>
            </roles>
        </developer>
        <developer>
            <name>Ona Systems</name>
            <email>info@opensrp.io</email>
            <organization>Ona Systems</organization>
            <organizationUrl>https://ona.io</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <verbose>true</verbose>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <showWarnings>true</showWarnings>
                        <compilerArgs>
                            <arg>-verbose</arg>
                            <arg>-Xlint:unchecked</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <includes>
                            <include>**/*Test*.java</include>
                        </includes>
                        <reportFormat>html</reportFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>install</phase>
                            <goals>
                                <goal>javadoc</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${maven-license-plugin.version}</version>
                    <configuration>
                        <properties>
                            <currentYear>2020</currentYear>
                        </properties>
                        <strictCheck>true</strictCheck>
                        <includes>
                            <include>src/**/*.java</include>
                        </includes>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-dependency-convergence</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central.publishing.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                    <!-- Sign EVERYTHING at verify so .asc exist before deploy -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Passphrase read automatically from MAVEN_GPG_PASSPHRASE env var -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
