<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>eu.europa.ted.eforms</groupId>
  <artifactId>efx-toolkit-java</artifactId>
  <version>2.0.0-alpha.9</version>
  <packaging>jar</packaging>

  <name>EFX Toolkit for Java</name>
  <description>
     Java library for the eForms Expression Language (EFX).
     It enables the transpilation of EFX expressions and templates to different target languages.
     It also provides an implementation that turns an EFX expression into XPath.
  </description>
  <url>https://docs.ted.europa.eu/eforms/latest/efx-toolkit/</url>

  <licenses>
    <license>
      <name>European Union Public Licence, Version 1.2</name>
      <url>https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/2020-03/EUPL-1.2%20EN.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>TED and EU Public Procurement Unit</name>
      <email>OP-TED-DEVOPS@publications.europa.eu</email>
      <organization>Publications Office of the European Union</organization>
      <organizationUrl>https://op.europa.eu/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/OP-TED/efx-toolkit-java.git</connection>
    <url>https://github.com/OP-TED/efx-toolkit-java.git</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.outputTimestamp>2026-09-17T10:29:14Z</project.build.outputTimestamp>

    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <sdk.antlr4.dir>${project.build.directory}/eforms-sdk/antlr4</sdk.antlr4.dir>

    <!-- Versions - eForms -->
    <version.eforms-sdk-1>1.16.0-beta.3</version.eforms-sdk-1>
    <version.eforms-sdk-2>2.0.0-alpha.4</version.eforms-sdk-2>
    <version.eforms-core>1.9.1</version.eforms-core>

    <!-- Versions - Third-party libraries -->
    <version.antlr4>4.13.1</version.antlr4>
    <version.commons-lang3>3.18.0</version.commons-lang3>
    <version.freemarker>2.3.34</version.freemarker>
    <version.logback>1.5.18</version.logback>
    <version.jackson>2.18.3</version.jackson>
    <version.jackson-databind>2.18.3</version.jackson-databind>
    <version.junit-jupiter>5.7.2</version.junit-jupiter>
    <version.saxon-he>11.3</version.saxon-he>
    <version.slf4j>2.0.13</version.slf4j>

    <!-- Versions - Plugins -->
    <version.build-helper.plugin>3.3.0</version.build-helper.plugin>
    <version.dependency.plugin>3.3.0</version.dependency.plugin>
    <version.install.plugin>2.5.2</version.install.plugin>
    <version.jacoco.plugin>0.8.12</version.jacoco.plugin>
    <version.jar.plugin>3.2.0</version.jar.plugin>
    <version.javadoc.plugin>3.4.0</version.javadoc.plugin>
    <version.pgp.plugin>1.5</version.pgp.plugin>
    <version.central-publishing.plugin>0.8.0</version.central-publishing.plugin>
    <version.source.plugin>3.2.1</version.source.plugin>
    <version.surefire.plugin>3.2.5</version.surefire.plugin>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- eForms -->
      <dependency>
        <groupId>eu.europa.ted.eforms</groupId>
        <artifactId>eforms-core-java</artifactId>
        <version>${version.eforms-core}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.slf4j}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${version.logback}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${version.commons-lang3}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${version.jackson-databind}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${version.junit-jupiter}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-params</artifactId>
        <version>${version.junit-jupiter}</version>
      </dependency>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${version.antlr4}</version>
      </dependency>
      <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>${version.freemarker}</version>
      </dependency>
      <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>Saxon-HE</artifactId>
        <version>${version.saxon-he}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- eForms -->
    <dependency>
      <groupId>eu.europa.ted.eforms</groupId>
      <artifactId>eforms-core-java</artifactId>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.saxon</groupId>
      <artifactId>Saxon-HE</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>central-snapshots</id>
      <name>OSS Snapshots repository</name>
      <url>https://central.sonatype.com/repository/maven-snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${version.surefire.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${version.install.plugin}</version>
          <configuration>
            <createChecksum>true</createChecksum>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>${version.antlr4}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${version.build-helper.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${version.jacoco.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.jar.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.javadoc.plugin}</version>
          <configuration>
            <doclint>all,-missing</doclint>
            <sourceFileExcludes>
              <exclude>**/EfxLexer.java</exclude>
              <exclude>**/EfxParser.java</exclude>
              <exclude>**/EfxListener.java</exclude>
              <exclude>**/EfxBaseListener.java</exclude>
            </sourceFileExcludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${version.pgp.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.source.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>${version.central-publishing.plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${version.dependency.plugin}</version>
        <executions>
          <execution>
            <id>unpack-sdk-grammars</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <artifactItems>
            <artifactItem>
              <groupId>eu.europa.ted.eforms</groupId>
              <artifactId>eforms-sdk</artifactId>
              <version>${version.eforms-sdk-2}</version>
              <type>jar</type>
              <includes>eforms-sdk/efx-grammar/**/*.g4</includes>
              <outputDirectory>${sdk.antlr4.dir}/eu/europa/ted/efx/sdk2</outputDirectory>
              <fileMappers>
                <!-- Remove the folder prefix from filenames -->
                <org.codehaus.plexus.components.io.filemappers.FlattenFileMapper />
              </fileMappers>
            </artifactItem>
            <artifactItem>
              <groupId>eu.europa.ted.eforms</groupId>
              <artifactId>eforms-sdk</artifactId>
              <version>${version.eforms-sdk-1}</version>
              <type>jar</type>
              <includes>eforms-sdk/efx-grammar/**/*.g4</includes>
              <outputDirectory>${sdk.antlr4.dir}/eu/europa/ted/efx/sdk1</outputDirectory>
              <fileMappers>
                <!-- Remove the folder prefix from filenames -->
                <org.codehaus.plexus.components.io.filemappers.FlattenFileMapper />
              </fileMappers>
            </artifactItem>
          </artifactItems>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>antlr-sdk</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
            <configuration>
              <sourceDirectory>${sdk.antlr4.dir}</sourceDirectory>
            </configuration>
          </execution>
          <execution>
            <id>antlr-efx</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/antlr4/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/EfxBaseListener.class</exclude>
            <exclude>**/EfxLexer.class</exclude>
            <exclude>**/EfxParser*.class</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <!-- Profile "release" caters to the requirements for releasing to Maven Central -->
      <id>release</id>
      <properties>
        <maven.compiler.debug>false</maven.compiler.debug>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <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>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <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>
            <configuration>
              <!-- Prevent gpg from using pinentry programs -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <!-- Name displayed on the Central Portal "Deployments" page -->
              <deploymentName>${project.artifactId} ${project.version}</deploymentName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
