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

  <groupId>org.gnu.inet</groupId>
  <artifactId>libidn</artifactId>
  <version>2026.10.0</version>
  <packaging>jar</packaging>

  <name>GNU IDN Library</name>
  <description>
    GNU Libidn is a fully documented implementation of the Stringprep,
    Punycode and IDNA specifications. Libidn's purpose is to encode
    and decode internationalized domain names.
  </description>
  <url>https://www.gnu.org/software/libidn/</url>
  <inceptionYear>2002</inceptionYear>

  <organization>
    <name>GNU</name>
    <url>https://www.gnu.org/</url>
  </organization>

  <!-- The library may be used under any one of these licenses. -->
  <licenses>
    <license>
      <name>GNU Lesser General Public License version 3.0 or later</name>
      <url>https://www.gnu.org/licenses/lgpl-3.0.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>GNU General Public License version 2.0 or later</name>
      <url>https://www.gnu.org/licenses/old-licenses/gpl-2.0.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Simon Josefsson</name>
      <email>simon@josefsson.org</email>
      <roles><role>maintainer</role></roles>
    </developer>
    <developer>
      <name>Guus der Kinderen</name>
      <email>guus.der.kinderen@gmail.com</email>
      <roles><role>maintainer</role></roles>
    </developer>
  </developers>

  <contributors>
    <contributor>
      <name>Oliver Hitz</name>
      <roles><role>author</role></roles>
    </contributor>
    <contributor>
      <name>Stefan Larsson</name>
      <roles><role>developer</role></roles>
    </contributor>
  </contributors>

  <scm>
    <connection>scm:git:https://codeberg.org/libidn/libidn-java.git</connection>
    <developerConnection>scm:git:ssh://git@codeberg.org/libidn/libidn-java.git</developerConnection>
    <url>https://codeberg.org/libidn/libidn-java</url>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>8</maven.compiler.release>
    <maven.compiler.showWarnings>true</maven.compiler.showWarnings>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
    <!-- Fixed timestamp makes the jars reproducible. Bump on each release. -->
    <project.build.outputTimestamp>2026-10-12T00:00:00Z</project.build.outputTimestamp>
    <generator.classes>${project.build.directory}/generator-classes</generator.classes>
    <generator.work>${project.build.directory}/generator-work</generator.work>
    <generator.sources>${project.build.directory}/generated-sources/tables</generator.sources>
    <jmh.version>1.37</jmh.version>
    <!-- Extra JMH command line options, e.g. -Djmh.args="-f 1 -wi 1 Node" -->
    <jmh.args></jmh.args>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${jmh.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- The license files go into META-INF of the binary and sources jars. -->
    <resources>
      <resource>
        <directory>${project.basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>COPYING</include>
          <include>COPYING.LESSERv3</include>
          <include>COPYINGv2</include>
          <include>LICENSE-2.0.txt</include>
          <include>LICENSE-RFC3454.txt</include>
          <include>LICENSE-Unicode.txt</include>
        </includes>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.13.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.4.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.7</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.7.0</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!--
        The Stringprep and NFKC tables (RFC3454.java, CombiningClass.java,
        Composition.java, DecompositionKeys.java, DecompositionMappings.java)
        are generated from the RFC 3454 and Unicode 3.2 data files in
        src/generator/data, by the programs in src/generator/java. Those
        programs read their input from, and write their output to, the
        current directory, so they are run in a scratch work directory.
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>compile-generators</id>
            <phase>generate-sources</phase>
            <goals><goal>compile</goal></goals>
            <configuration>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/generator/java</compileSourceRoot>
              </compileSourceRoots>
              <outputDirectory>${generator.classes}</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <!-- Generates the JMH benchmark harness for StringprepBenchmark. -->
            <id>default-testCompile</id>
            <configuration>
              <annotationProcessorPaths>
                <path>
                  <groupId>org.openjdk.jmh</groupId>
                  <artifactId>jmh-generator-annprocess</artifactId>
                  <version>${jmh.version}</version>
                </path>
              </annotationProcessorPaths>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-generator-input</id>
            <phase>generate-sources</phase>
            <goals><goal>copy-resources</goal></goals>
            <configuration>
              <outputDirectory>${generator.work}</outputDirectory>
              <resources>
                <resource><directory>${project.basedir}/src/generator/data</directory></resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-generator-output</id>
            <phase>process-sources</phase>
            <goals><goal>copy-resources</goal></goals>
            <configuration>
              <outputDirectory>${generator.sources}/gnu/inet/encoding</outputDirectory>
              <resources>
                <resource>
                  <directory>${generator.work}</directory>
                  <includes><include>*.java</include></includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <executable>${java.home}/bin/java</executable>
          <workingDirectory>${generator.work}</workingDirectory>
        </configuration>
        <executions>
          <execution>
            <id>generate-rfc3454</id>
            <phase>generate-sources</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
              <arguments>
                <argument>-classpath</argument>
                <argument>${generator.classes}</argument>
                <argument>GenerateRFC3454</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>generate-nfkc</id>
            <phase>generate-sources</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
              <arguments>
                <argument>-classpath</argument>
                <argument>${generator.classes}</argument>
                <argument>GenerateNFKC</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <phase>generate-sources</phase>
            <goals><goal>add-source</goal></goals>
            <configuration>
              <sources><source>${generator.sources}</source></sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals><goal>jar-no-fork</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.2</version>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Run the JMH micro-benchmarks: ./mvnw test -Pjmh -->
    <profile>
      <id>jmh</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>run-benchmarks</id>
                <phase>test</phase>
                <goals><goal>exec</goal></goals>
                <configuration>
                  <workingDirectory>${project.build.directory}</workingDirectory>
                  <classpathScope>test</classpathScope>
                  <commandlineArgs>-classpath %classpath org.openjdk.jmh.Main -rf json -rff jmh-result.json ${jmh.args}</commandlineArgs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Sign and publish to Maven Central: ./mvnw deploy -Prelease -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals><goal>sign</goal></goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
