Sam, Some additional notes that I found to be the case when I set up ANTLR and Maven just recently.
1) Use the plugin described here, exactly as described: http://antlr.org/antlr3-maven-plugin/index.html. 2) Use version '3.1.3-1' or better. It's available in central, so you can just update your plugins and away you go. 3) If you want to call the plugin directly, use 'mvn groupId:artifactId:antlr', not just 'antlr3:antlr' which will actually download and call a version by codehaus, which I tore my hair out with. I won't call it buggy, but it was an entirely unpleasant experience. 4) It wasn't entirely clear to me where to put the grammars at first; they go into 'src/main/antlr3/your/package/hierarchy/here'. The generated files will be created in the same hierarchy. Unfortunately, just like Java, you also have to give your grammar a package name to use. 5) I couldn't get m2eclipse to "see" the generated source directory; you might just have to add it to the list of source folders like I did. Sean On Tue, Jun 30, 2009 at 6:19 AM, James Abley <[email protected]> wrote: > 2009/6/30 Sam Barnett-Cormack <[email protected]>: > > Hi all, > > > > So, currently I'm using eclipse with ANTLR IDE, and it's working nicely. > > I'm moving toward mavenising my work (which is broken into multiple > > projects), and the bits without ANTLR use are going fine. > > > > However, for the ANTLR bits, I'd ideally make use of maven's ANTLR > > plugin to make the project portable outside of eclipse. I also want to > > keep using at least the editor/debugger functionality of ANTLR IDE. Is > > there any way that people know of to marry these? How would I go about > > adding ANTLR to the maven pom for plugin as well as dependency? Are > > there docs, and where? And does anyone have experience of doing this in > > Eclipse and marrying it with an ANTLR Eclipse plugin? > > > > Thanks, > > > > Sam > > > > PS: I'm planning to ask the m2eclipse list as well, I just thought I'd > > try here first. > > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > > > > Hi Sam, > > I have something like the following in my projects: > > <plugin> > <groupId>org.antlr</groupId> > <artifactId>antlr3-maven-plugin</artifactId> > <version>3.1.1.2</version> > <executions> > <execution> > <goals> > <goal>antlr</goal> > </goals> > </execution> > </executions> > </plugin> > > Doing a maven build on a project puts stuff into > my-module/target/generated-sources/antlr and either Eclipse / > M2Eclipse or myself edited the project classpath to reference the > generated classes. > > Cheers, > > James > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
