[antlr-interest] using the antlr maven repository

Jim Idle jimi at temporal-wave.com
Mon Mar 30 07:59:53 PDT 2009


Pete Siemsen wrote:
> I have had ANTLR working with maven for a while.  I'm interested in  
> using a newer ANTLR.  The one in my repository is 2.7.7.  I'd like to  
> use newer version of ANTLR if possible.  I have the repository  
> definition suggested by the web page at http://www.antlr.org/wiki/display/ANTLR3/2008/11/20/Maven+and+Hudson+continuous+build+server+now+running
>
> If I change my (working) pom.xml from
>
>                  <dependency>
>                          <groupId>org.antlr</groupId>
>                          <artifactId>antlr-runtime</artifactId>
>                          <version>3.0.1</version>
>                  </dependency>
>
> to
>
>                  <dependency>
>                          <groupId>org.antlr</groupId>
>                          <artifactId>antlr-runtime</artifactId>
>                          <version>3.1.3</version>
>                  </dependency>
>
> I get the 3.1.3, and I get lots of "cannot find symbol _fsp" and  
> "cannot find symbol errorRecovery".  I've tried deleting my ~/.m2/ 
> reposinory/antlr/antlr/2.7.7, aonly to watch it get downloaded again.
>   
v3 is dependent on 2.7.7 but it does not use it to compile the grammars. 
You will need to do the following:

1) mvn clean
2) Move your .g files under src/main/antlr3 (unless you specify a 
different location but it is better to use the Maven defaults as it 
reduces pom complexity). The v2 plugin unfortunately used the directory 
antlr instead of antlr2, so the v3 plugin now defaults to anltr3 to 
avoid confusion.
3) Of course your v2 grammars will not work with v3 out of the box, you 
must convert them, which is generally fairly simple but in some cases 
can be involved.

Documentation for plugin is at:

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

Finally, you do not need a different repository as ANTLR is now part of 
the Maven central repository and synced directly from our own release 
repository.

Hope that helps,

Jim




More information about the antlr-interest mailing list