0
votes

Eclipse Oxygen.3a Release 4.7.3a Maven

I have a project, with a lot of classes.

I tried to create an Antlr4 grammar, so I have my .g4 file on src/main/java/antlr4/mygrammar.g4.

Antlr4 does not generate generate anything.

My pom.xml:

<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>wiz</groupId>
<artifactId>calculo</artifactId>
<version>0.0.1</version>
<name>calculo</name>
<description>Cálculo do Sistema de Folha de Pagamento</description>

<scm>
    <connection>scm:git:https://github.com/zsoltherpai/fluent-jdbc.git</connection>
    <developerConnection>scm:git:[email protected]:zsoltherpai/fluent-jdbc.git</developerConnection>
    <url>https://github.com/zsoltherpai/fluent-jdbc</url>
</scm>

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
    <dependency>
        <groupId>org.codejargon</groupId>
        <artifactId>fluentjdbc</artifactId>
        <version>1.8.3</version>
    </dependency>

    <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4</artifactId>
        <version>4.7.1</version>
    </dependency>

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-maven-plugin</artifactId>
            <version>4.7.1</version>
            <executions>
                <execution>
                    <id>antlr</id>
                    <goals>
                        <goal>antlr4</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

What am I missing? Do I need to invoke manually something?

1

1 Answers

0
votes

I have my .g4 file on src/main/java/antlr4/mygrammar.g4.

The ANTLR4 maven plug-in expects the grammars to be in src/main/antlr4, not src/main/java/antlr4.