<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
  <parent>
    <groupId>org.neo4j</groupId>
    <artifactId>cypher-parser-parent</artifactId>
    <version>2025.09.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>cypher-preparser</artifactId>
  <packaging>jar</packaging>
  <name>Cypher pre-parser</name>

  <description>Cypher pre-parser</description>

  <properties>
    <moduleName>org.neo4j.cypher.internal.preparser</moduleName>
    <spotless.check.skip>true</spotless.check.skip>
    <dependency.analyze.failOnWarning>true</dependency.analyze.failOnWarning>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>cypher-antlr-ast-common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>neo4j-common</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <id>antlr</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>antlr4</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <listener>true</listener>
          <visitor>false</visitor>
          <treatWarningsAsErrors>true</treatWarningsAsErrors>
        </configuration>
      </plugin>
      <plugin>
        <!-- disable scala-maven-plugin, because we have no scala -->
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>scala-compile</id>
            <phase>none</phase>
          </execution>
        </executions>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
          <appendAssemblyId>true</appendAssemblyId>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <id>grammar</id>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/grammar.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <!-- Antlr generates star imports so ignore it -->
                <RestrictImports>
                  <excludedSourceRoot>target/generated-sources/antlr4</excludedSourceRoot>
                </RestrictImports>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
