[antlr-interest] Guidance sought on use of Maven and Eclipse
Sean O'Dell
sean at celsoft.com
Tue Jun 30 07:31:37 PDT 2009
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 <james.abley at gmail.com> wrote:
> 2009/6/30 Sam Barnett-Cormack <s.barnett-cormack at lancaster.ac.uk>:
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090630/ad7fda8d/attachment.html
More information about the antlr-interest
mailing list