[antlr-interest] Maven antlr integration ?

Jim Idle jimi at temporal-wave.com
Sun Feb 20 21:31:13 PST 2011


As I said before, please use 3.2 not 3.3.



Jim



*From:* Vijay Raj [mailto:call.vijayraj at yahoo.com]
*Sent:* Sunday, February 20, 2011 6:06 PM
*To:* Jim Idle; antlr-interest at antlr.org
*Subject:* Re: [antlr-interest] Maven antlr integration ?



Thanks, Jim for the pointers.



I cleaned my maven cache.



Here are the errors on the console:



[INFO] --- antlr3-maven-plugin:3.3:antlr (default) @ core ---

[INFO] ANTLR: Processing source directory ../core/src/main/antlr3

ANTLR Parser Generator  Version 3.3 Nov 30, 2010 12:46:29

error(7):  cannot find or open file: null/Java.g

[INFO]
------------------------------------------------------------------------

[INFO] BUILD FAILURE



[ERROR] Failed to execute goal org.antlr:antlr3-maven-plugin:3.3:antlr
(default) on project core: ANTLR caught 1 build errors. -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please
read the following articles:

[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



Java.g is indeed present as per the directory structure recommended in the
wiki.



../core$ ls src/main/antlr3/Java.g

src/main/antlr3/Java.g



The plugin fragment appears as below:  (using v 3.3 , the latest ).



   <plugin>

    <groupId>org.antlr</groupId>

    <artifactId>antlr3-maven-plugin</artifactId>

    <version>3.3</version>

    <executions>

        <execution>

            <goals>

                <goal>antlr</goal>

            </goals>

        </execution>

    </executions>

   </plugin>



What else could I be missing ?




------------------------------

*From:* Jim Idle <jimi at temporal-wave.com>
*To:* Vijay Raj <call.vijayraj at yahoo.com>; antlr-interest at antlr.org
*Sent:* Sun, February 20, 2011 9:56:44 PM
*Subject:* RE: [antlr-interest] Maven antlr integration ?

I don't think that you are using the correct version of the documentation
and 3.1.3-1 is the wrong version of the maven plugin anyway.

Why not create your project using the archetype 3.2 and then just overlay
your own .g file. See:

http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+Projects+with+Mave
n

Use version 3.2 as in the article as 3.3 seems not to work and I have not
had time to look at why just yet.

And also see the docs for the plugin at:

http://www.antlr.org/antlr3-maven-plugin/index.html

I think you are following docs for the ANTLR 2 plugin or something.

Jim



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Vijay Raj
> Sent: Saturday, February 19, 2011 7:53 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Maven antlr integration ?
>
> For a particular task regarding parsing java 6 grammars - my maven
> configuration of using antlr looks like this:
>
>
>    <plugin>
>      <groupId>org.antlr</groupId>
>      <artifactId>antlr3-maven-plugin</artifactId>
>      <version>3.1.3-1</version>
>            <configuration>
>                <goals>
>                    <goal>antlr</goal>
>                </goals>
>                <conversionTimeout>10000</conversionTimeout>
>                <grammars>java.g</grammars>
>            </configuration>
>
>
> I am getting the following error message:
>
> Failed to execute goal
> org.apache.maven.plugins:maven-antlr-plugin:2.0-beta-1:generate
> (default-cli) on
> project root: The parameters 'grammars' for goal
> org.apache.maven.plugins:maven-antlr-plugin:2.0-beta-1:generate are
> missing or
> invalid -> [Help 1]
>
> The documentation under reference:
> http://www.antlr.org/wiki/display/ANTLR3/Using+ANTLR+3+with+Maven+2 .
> Is that up
> to date with the reality ?
>
> I am using the Java 6 grammar as in the grammars page, thanks to Yang
> Jiang ,
> here at : http://openjdk.java.net/projects/compiler-
> grammar/antlrworks/Java.g
>  .
>
> $ mvn --version
> Apache Maven 3.0.2 (r1056850; 2011-01-09 06:28:10+0530)
>
>
> Let me know what I could be missing here !
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list