[antlr-interest] Problems with Maven plugin

Antonio Petrelli antonio.petrelli at gmail.com
Sat Jan 9 11:50:00 PST 2010


I forgot to say that I am using the 3.2 version of the plugin and of ANTLR.

Moreover if I move the Java.g file under another subdirectory (say
'foo'), it is created under the 'foo' directory but the "package"
instruction is not included in the Java code.

Thanks
Antonio

2010/1/9 Antonio Petrelli <antonio.petrelli at gmail.com>:
> Hi all
> Sorry for being an ANTLR newbie. I would like to use the Maven plugin.
> When I try to generate (through mvn compile) sources of the Java.g 1.6
> parser, the plugin gives me an error (full log below in the mail):
>
> error(7):  cannot find or open file: null/Java.g
>
> However, if I copy the same file under the "null" directory, it
> generates the code!
>
> I am using Maven 2.2.1 under Linux Kubuntu 9.10 amd64, OpenJDK 1.6 b16
>
> You can check it live at this address:
> http://svn.eu.apache.org/repos/asf/tiles/sandbox/trunk/tiles-autotag/tiles-autotag-core/
>
> Thanks in advance
> Antonio Petrelli
>
> -----------------
> Full Log
>
> mvn clean compile -e
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Autotag - Core
> [INFO]    task-segment: [clean, compile]
> [INFO] ------------------------------------------------------------------------
> [INFO] [clean:clean {execution: default-clean}]
> [INFO] Deleting directory
> /home/antonio/javadev/workspace-sandbox/tiles-autotag/tiles-autotag-core/target
> [INFO] [antlr3:antlr {execution: default}]
> [INFO] ANTLR: Processing source directory
> /home/antonio/javadev/workspace-sandbox/tiles-autotag/tiles-autotag-core/src/main/antlr3
> ANTLR Parser Generator  Version 3.2 Sep 23, 2009 14:05:07
> error(7):  cannot find or open file: null/Java.g
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] ANTLR caught 1 build errors.
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: ANTLR caught 1
> build errors.
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: ANTLR
> caught 1 build errors.
>        at org.antlr.mojo.antlr3.Antlr3Mojo.execute(Antlr3Mojo.java:397)
>        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>        ... 17 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1 second
> [INFO] Finished at: Sat Jan 09 20:36:42 CET 2010
> [INFO] Final Memory: 9M/67M
> [INFO] ------------------------------------------------------------------------
>
> -------------
>
> Maven configuration:
>
> <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">
>    <modelVersion>4.0.0</modelVersion>
>    <parent>
>        <artifactId>tiles-autotag</artifactId>
>        <groupId>org.apache.tiles</groupId>
>        <version>1.0-SNAPSHOT</version>
>    </parent>
>    <groupId>org.apache.tiles</groupId>
>    <artifactId>tiles-autotag-core</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <name>Autotag - Core</name>
>    <description>Core classes for Autotag.</description>
>    <build>
>        <plugins>
>            <plugin>
>                <groupId>org.antlr</groupId>
>                <artifactId>antlr3-maven-plugin</artifactId>
>                <version>3.2</version>
>                <configuration>
>                    <includes>
>                        <include>Java.g</include>
>                    </includes>
>                </configuration>
>                <executions>
>                    <execution>
>                        <goals>
>                            <goal>antlr</goal>
>                        </goals>
>                    </execution>
>                </executions>
>            </plugin>
>        </plugins>
>    </build>
>    <dependencies>
>        <dependency>
>            <groupId>org.antlr</groupId>
>            <artifactId>antlr-runtime</artifactId>
>            <version>3.2</version>
>            <type>jar</type>
>            <scope>compile</scope>
>        </dependency>
>    </dependencies>
> </project>
>


More information about the antlr-interest mailing list