<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.ta4j</groupId>
    <artifactId>ta4j-parent</artifactId>
    <version>0.22.4</version>
    <packaging>pom</packaging>

    <name>Ta4j Parent</name>
    <description>ta4j is a Java library providing a simple API for technical analysis.</description>
    <url>https://github.com/ta4j/ta4j</url>
    <inceptionYear>2014</inceptionYear>

    <developers>
        <developer>
            <id>mdeverdelhan</id>
            <name>Marc de Verdelhan</name>
        </developer>
        <developer>
            <id>team172011</id>
            <name>Simon-Justus Wimmer</name>
        </developer>
        <developer>
            <id>TheCookieLab</id>
            <name>David Pang</name>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <comments>All source code is under the MIT license.</comments>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/ta4j/ta4j/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <name>Central Portal Snapshot Repository</name>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:git://github.com/ta4j/ta4j.git</connection>
        <developerConnection>scm:git:git@github.com:ta4j/ta4j.git</developerConnection>
        <url>https://github.com/ta4j/ta4j</url>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>ta4j-core</module>
        <module>ta4j-examples</module>
    </modules>

    <properties>
        <!-- Encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Build -->
        <maven.compiler.release>21</maven.compiler.release>
        <maven.surefire.version>3.5.4</maven.surefire.version>

        <!-- Dependencies -->
        <assertj.version>3.27.7</assertj.version>
        <commons-math3.version>3.6.1</commons-math3.version>
        <gson.version>2.13.2</gson.version>
        <jfreechart.version>1.5.6</jfreechart.version>
        <junit-jupiter.version>6.0.2</junit-jupiter.version>
        <log4j2.version>2.25.3</log4j2.version>
        <mockito.version>5.21.0</mockito.version>
        <opencsv.version>5.12.0</opencsv.version>
        <poi.version>5.5.1</poi.version>
        <slf4j.version>2.0.17</slf4j.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit-jupiter.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>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-math3</artifactId>
                <version>${commons-math3.version}</version>
            </dependency>
            <dependency>
                <groupId>com.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>${opencsv.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>${poi.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jfree</groupId>
                <artifactId>jfreechart</artifactId>
                <version>${jfreechart.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>

        <!-- Only when performing a release (i.e. not for snapshots) -->
        <profile>
            <id>production-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.10.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Artifact signing -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <configuration>
                            <!-- Prevent gpg from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Sign snapshots when deploying -->
        <profile>
            <id>sign-snapshots</id>
            <build>
                <plugins>
                    <!-- Artifact signing -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <configuration>
                            <!-- Prevent gpg from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.2</version>
                <executions>
                    <execution>
                        <id>enforce-build-environment</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.9.0,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>[21,)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Build source and target -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.1</version>
                <configuration>
                    <release>${maven.compiler.release}</release>
                    <parameters>true</parameters>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-proc:full</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <useModulePath>false</useModulePath>
                    <argLine>
                        -XX:+EnableDynamicAgentLoading
                        -Xshare:off
                        -Djdk.instrument.traceUsage=false
                    </argLine>
                </configuration>
            </plugin>
            <!-- Package sources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- License headers -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>5.0.0</version>
                <configuration>
                    <licenseSets>
                        <licenseSet>
                            <header>${project.basedir}/license-header.txt</header>
                            <includes>
                                <include>**/*.java</include>
                            </includes>
                        </licenseSet>
                    </licenseSets>
                </configuration>
            </plugin>

            <!-- Source formatter -->
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.29.0</version>
                <configuration>
                    <configFile>${project.basedir}/code-formatter.xml</configFile>
                </configuration>
            </plugin>

            <!-- Releases -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.shared</groupId>
                        <artifactId>maven-invoker</artifactId>
                        <version>3.3.0</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Version plugin -->
            <!-- mvn versions:display-dependency-updates -->
            <!-- mvn versions:display-plugin-updates -->
            <!-- mvn versions:display-property-updates -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <ruleSet>
                        <ignoreVersions>
                            <ignoreVersion>
                                <type>regex</type>
                                <version>(?i).*-SNAPSHOT.*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <type>regex</type>
                                <version>(?i).*(?:-alpha(?:[.-]?\d+)?|-beta(?:[.-]?\d+)?).*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <type>regex</type>
                                <version>(?i).*(?:-milestone(?:[.-]?\d+)?|-m\d+).*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <type>regex</type>
                                <version>(?i).*(?:-rc(?:[.-]?\d+)?|-cr(?:[.-]?\d+)?).*</version>
                            </ignoreVersion>
                        </ignoreVersions>
                    </ruleSet>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>
