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

    Copyright (c) 2002-2024, the original author or authors.

    This software is distributable under the BSD license. See the terms of the
    BSD license in the documentation provided with this software.

    https://opensource.org/licenses/BSD-3-Clause

-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jline</groupId>
    <artifactId>jline-parent</artifactId>
    <version>4.0.9</version>
    <packaging>pom</packaging>
    <name>JLine</name>
    <description>JLine</description>
    <url child.project.url.inherit.append.path="false">https://github.com/jline/jline3</url>

    <licenses>
        <license>
            <name>The BSD License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>gnodet</id>
            <name>Guillaume Nodet</name>
            <email>gnodet@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <name>jline-users</name>
            <subscribe>https://groups.google.com/group/jline-users</subscribe>
            <unsubscribe>mailto:jline-users+unsubscribe@googlegroups.com</unsubscribe>
            <post>mailto:jline-users@googlegroups.com</post>
            <archive>https://groups.google.com/group/jline-users</archive>
        </mailingList>
    </mailingLists>

    <modules>
        <module>native</module>
        <module>terminal</module>
        <module>terminal-ffm</module>
        <module>terminal-jni</module>
        <module>reader</module>
        <module>shell</module>
        <module>builtins</module>
        <module>console-ui</module>
        <module>prompt</module>
        <module>console</module>
        <module>picocli</module>
        <module>groovy</module>
        <module>remote-ssh</module>
        <module>remote-telnet</module>
        <module>style</module>
        <module>demo</module>
        <module>graal</module>
        <module>jansi-core</module>
    </modules>

    <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
        <connection>scm:git:https://github.com/jline/jline3.git</connection>
        <developerConnection>scm:git:https://github.com/jline/jline3.git</developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/jline/jline3</url>
    </scm>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/jline/jline3/issues</url>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>jline-publish</id>
            <name>JLine3 Releases</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
        <snapshotRepository>
            <id>jline-publish</id>
            <name>JLine3 Snapshots</name>
            <url>https://central.sonatype.com/repository/maven-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.outputTimestamp>${nisse.jgit.dateIso8601}</project.build.outputTimestamp>

        <java.build.version>22</java.build.version>
        <java.release.version>11</java.release.version>
        <maven.version>3.9.0</maven.version>

        <native.image.skip>true</native.image.skip>
        <automatic.module.name />

        <jansi.version>2.4.2</jansi.version>
        <juniversalchardet.version>1.0.3</juniversalchardet.version>
        <sshd.version>2.17.1</sshd.version>
        <easymock.version>5.6.0</easymock.version>
        <junit.version>6.0.3</junit.version>
        <gogo.runtime.version>1.1.6</gogo.runtime.version>
        <gogo.jline.version>1.1.8</gogo.jline.version>
        <slf4j.version>2.0.17</slf4j.version>
        <findbugs.version>3.0.2</findbugs.version>
        <groovy.version>5.0.4</groovy.version>
        <ivy.version>2.5.3</ivy.version>
        <picocli.version>4.7.7</picocli.version>
        <graal.version>25.0.2</graal.version>
        <graal.plugin.version>21.2.0</graal.plugin.version>
        <native.plugin.version>0.11.5</native.plugin.version>
        <palantir.version>2.89.0</palantir.version>

        <surefire.argLine>--add-opens java.base/java.io=org.jline.nativ --add-opens java.base/java.io=org.jline.terminal</surefire.argLine>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-native</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-terminal</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-terminal-ffm</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-terminal-jni</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-reader</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-shell</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-builtins</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-console-ui</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-prompt</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-console</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-picocli</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-groovy</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-remote-ssh</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-remote-telnet</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline-style</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jansi-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.fusesource.jansi</groupId>
                <artifactId>jansi</artifactId>
                <version>${jansi.version}</version>
            </dependency>

            <dependency>
                <groupId>com.googlecode.juniversalchardet</groupId>
                <artifactId>juniversalchardet</artifactId>
                <version>${juniversalchardet.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-common</artifactId>
                <version>${sshd.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${sshd.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-scp</artifactId>
                <version>${sshd.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-sftp</artifactId>
                <version>${sshd.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.gogo.runtime</artifactId>
                <version>${gogo.runtime.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.gogo.jline</artifactId>
                <version>${gogo.jline.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${groovy.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy-json</artifactId>
                <version>${groovy.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy-console</artifactId>
                <version>${groovy.version}</version>
            </dependency>

            <dependency>
                <groupId>org.graalvm.sdk</groupId>
                <artifactId>graal-sdk</artifactId>
                <version>${graal.version}</version>
            </dependency>

            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${picocli.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.ivy</groupId>
                <artifactId>ivy</artifactId>
                <version>${ivy.version}</version>
            </dependency>

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

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-jdk14</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>${easymock.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${findbugs.version}</version>
            </dependency>

            <dependency>
                <groupId>com.palantir.javaformat</groupId>
                <artifactId>palantir-java-format</artifactId>
                <version>${palantir.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>apache-snapshots</id>
            <name>Apache Snapshots</name>
            <url>https://repository.apache.org/content/groups/snapshots</url>
        </repository>
    </repositories>

    <build>
        <defaultGoal>install</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.10.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>4.0.0-M16</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>6.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
                <plugin>
                    <groupId>org.graalvm.nativeimage</groupId>
                    <artifactId>native-image-maven-plugin</artifactId>
                    <version>${graal.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.graalvm.buildtools</groupId>
                    <artifactId>native-maven-plugin</artifactId>
                    <version>${native.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.6.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                    <configuration>
                        <showWarnings>true</showWarnings>
                        <release>${java.release.version}</release>
                        <compilerArgs>
                            <arg>-Xlint:all,-options,-processing,-restricted,-requires-automatic,-requires-transitive-automatic</arg>
                            <arg>-Werror</arg>
                        </compilerArgs>
                        <fork>true</fork>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-testCompile</id>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                            <phase>test-compile</phase>
                            <configuration>
                                <compilerArgs>
                                    <arg>-Xlint:all,-options,-processing,-exports,-restricted,-missing-explicit-ctor</arg>
                                    <!-- Remove -Werror for test compilation -->
                                </compilerArgs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.6.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                            <phase>verify</phase>
                            <configuration>
                                <bestPractices>true</bestPractices>
                                <useAgent>false</useAgent>
                                <signer>bc</signer>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>4.3.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.12.0</version>
                    <configuration>
                        <notimestamp>true</notimestamp>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-wrapper-plugin</artifactId>
                    <version>3.3.4</version>
                </plugin>

                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>3.4.0</version>
                    <configuration>
                        <java>
                            <toggleOffOn />
                            <palantirJavaFormat>
                                <version>${palantir.version}</version>
                            </palantirJavaFormat>
                            <importOrder>
                                <order>java|javax,org,,\#</order>
                            </importOrder>
                            <removeUnusedImports />
                            <licenseHeader>
                                <content>/*
 * Copyright (c) the original author(s).
 *
 * This software is distributable under the BSD license. See the terms of the
 * BSD license in the documentation provided with this software.
 *
 * https://opensource.org/licenses/BSD-3-Clause
 */</content>
                            </licenseHeader>
                        </java>
                        <pom>
                            <sortPom>
                                <expandEmptyElements>false</expandEmptyElements>
                                <nrOfIndentSpace>4</nrOfIndentSpace>
                                <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                            </sortPom>
                        </pom>
                        <upToDateChecking>
                            <enabled>true</enabled>
                        </upToDateChecking>
                    </configuration>
                    <dependencies>
                        <!--
                        <dependency>
                            <groupId>org.apache.maven.shared</groupId>
                            <artifactId>maven-shared-resources</artifactId>
                            <version>5</version>
                        </dependency>
                        -->
                    </dependencies>
                    <executions>
                        <execution>
                            <goals>
                                <goal>${spotless.action}</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.2</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${maven.version}</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${java.build.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>*;-noimport:=true</Export-Package>
                        <_removeheaders>Bnd-LastModified,Include-Resource,Private-Package</_removeheaders>
                        <_reproducible>true</_reproducible>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        <manifestEntries>
                            <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <argLine>${surefire.argLine}</argLine>
                    <failIfNoTests>false</failIfNoTests>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>

            <plugin>
                <groupId>org.graalvm.nativeimage</groupId>
                <artifactId>native-image-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>bundle</id>
            <activation>
                <property>
                    <name>!nobundle</name>
                </property>
            </activation>
            <modules>
                <module>jline</module>
                <module>jansi</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>source-jar</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>javadoc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclint>none</doclint>
                            <notimestamp>true</notimestamp>
                            <additionalOptions>${javadocOptions}</additionalOptions>
                            <failOnError>false</failOnError>
                            <legacyMode>true</legacyMode>
                        </configuration>
                        <executions>
                            <execution>
                                <id>javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>native-image-ffm</id>
            <properties>
                <native.image.skip>false</native.image.skip>
            </properties>
        </profile>
        <profile>
            <id>native-image-jni</id>
            <properties>
                <native.image.skip>false</native.image.skip>
            </properties>
        </profile>

        <profile>
            <id>format-check</id>
            <activation>
                <property>
                    <name>!format</name>
                </property>
            </activation>
            <properties>
                <spotless.action>check</spotless.action>
            </properties>
        </profile>

        <profile>
            <id>format</id>
            <activation>
                <property>
                    <name>format</name>
                </property>
            </activation>
            <properties>
                <spotless.action>apply</spotless.action>
            </properties>
        </profile>

        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
