[antlr-interest] Antlr3 in Eclipse and Maven?

Brad Cox bradjcox at gmail.com
Wed Jun 20 04:48:12 PDT 2012


A clue? Running maven from the command line like this DOES at least compile
.g to .java but that's hardly a practical workaround:

mvn org.antlr:antlr3-maven-plugin:3.1.3-1:antlr

[INFO] Scanning for projects...
> [INFO]
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Xacml-Antlr 1.0-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- antlr3-maven-plugin:3.1.3-1:antlr (default-cli) @ Xacml-Antlr
> ---
> [INFO] ANTLR: Processing source directory
> /Users/Brad/Dropbox/Xacml-Antlr/src/main/antlr3
> ANTLR Parser Generator  Version 3.1.3 Mar 17, 2009 19:23:44
> my/Xacml.g
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS


which suggests a plugin bug, probably in its handling
of <goal>antlr3</goal>. I don't think maven has an antlr3 goal so its not
firing the plugin.

On Wed, Jun 20, 2012 at 7:31 AM, Brad Cox <bradjcox at gmail.com> wrote:

> It seems the maven problem is that the plugin isn't launching, neither
> during mvn install or mvn-generate-sources. I've never seen this before.
> Anybody got a clue?
>
> I've attached the whole pom. Could someone try it out?
>
>
> On Wed, Jun 20, 2012 at 7:23 AM, Brad Cox <bradjcox at gmail.com> wrote:
>
>> I'm easy; I just want whatever version WORKS. And that's the one
>> specified in the wiki. Open with defaults to Antlr editor. Is that what you
>> mean?
>>
>>
>> On Wed, Jun 20, 2012 at 7:20 AM, Jim Idle <jimi at temporal-wave.com> wrote:
>>
>>> Do you want that version? However, what is the association in Eclipse
>>> with
>>> .g files?
>>>
>>>
>>>
>>> Jim
>>>
>>>
>>>
>>> *From:* Brad Cox [mailto:bradjcox at gmail.com]
>>> *Sent:* Wednesday, June 20, 2012 7:13 PM
>>> *To:* Jim Idle
>>> *Cc:* Terence Parr; ANTLR interest; stringtemplate-interest at antlr.org
>>> *Subject:* Re: [antlr-interest] Antlr3 in Eclipse and Maven?
>>>
>>>
>>>
>>> I'm using it exactly as in the wiki.
>>>
>>> <plugin>
>>>
>>> <groupId>org.antlr</groupId>
>>>
>>> <artifactId>antlr3-maven-plugin</artifactId>
>>>
>>> <version>3.1.3-1</version>
>>>
>>> <executions>
>>>
>>> <execution>
>>>
>>> <configuration>
>>>
>>> <phase>generate-sources</phase>
>>>
>>> <goals>
>>>
>>> <goal>antlr3</goal>
>>>
>>> </goals>
>>>
>>> <conversionTimeout>10000</conversionTimeout>
>>>
>>> <debug>true</debug>
>>>
>>> <dfa>false</dfa>
>>>
>>> <nfa>false</nfa>
>>>
>>> <excludes>
>>>
>>> <exclude />
>>>
>>> </excludes>
>>>
>>> <includes>
>>>
>>> <include />
>>>
>>> </includes>
>>>
>>> <messageFormat>antlr</messageFormat>
>>>
>>> <printGrammar>false</printGrammar>
>>>
>>> <profile>false</profile>
>>>
>>> <report>true</report>
>>>
>>> <sourceDirectory>src/main/antlr3</sourceDirectory>
>>>
>>> <libDirectory>src/main/antlr3/imports</libDirectory>
>>>
>>> <outputDirectory>target/generated-sources/antlr3</outputDirectory>
>>>
>>> <trace>false</trace>
>>>
>>> <verbose>true</verbose>
>>>
>>> </configuration>
>>>
>>> </execution>
>>>
>>> </executions>
>>>
>>> </plugin>
>>>
>>> >From the log it looks like the plugin is not being launched except right
>>> after a clean:
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>> [INFO] Building Xacml-Antlr 1.0-SNAPSHOT
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO]
>>> [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
>>> Xacml-Antlr ---
>>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>>> [INFO] Copying 1 resource
>>> [INFO]
>>> [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @
>>> Xacml-Antlr ---
>>> [INFO] Nothing to compile - all classes are up to date
>>> [INFO]
>>> [INFO] --- maven-resources-plugin:2.4.3:testResources
>>> (default-testResources) @ Xacml-Antlr ---
>>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>>> [INFO] skip non existing resourceDirectory
>>> /Users/Brad/Dropbox/Xacml-Antlr/src/test/resources
>>> [INFO]
>>> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile)
>>> @
>>> Xacml-Antlr ---
>>> [INFO] No sources to compile
>>> [INFO]
>>> [INFO] --- maven-surefire-plugin:2.12:test (default-test) @ Xacml-Antlr
>>> ---
>>> [INFO] Tests are skipped.
>>> [INFO]
>>> [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ Xacml-Antlr ---
>>> [INFO] Building jar:
>>> /Users/Brad/Dropbox/Xacml-Antlr/target/Xacml-Antlr-1.0-SNAPSHOT.jar
>>> [INFO] META-INF/maven/Xacml/Xacml-Antlr/pom.xml already added, skipping
>>> [INFO] META-INF/maven/Xacml/Xacml-Antlr/pom.properties already added,
>>> skipping
>>> [INFO]
>>> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @
>>> Xacml-Antlr ---
>>> [INFO] Installing
>>> /Users/Brad/Dropbox/Xacml-Antlr/target/Xacml-Antlr-1.0-SNAPSHOT.jar to
>>>
>>> /Users/Brad/.m2/repository/Xacml/Xacml-Antlr/1.0-SNAPSHOT/Xacml-Antlr-1.0-SNAPSHOT.jar
>>> [INFO] Installing /Users/Brad/Dropbox/Xacml-Antlr/pom.xml to
>>>
>>> /Users/Brad/.m2/repository/Xacml/Xacml-Antlr/1.0-SNAPSHOT/Xacml-Antlr-1.0-SNAPSHOT.pom
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] BUILD SUCCESS
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>> On Wed, Jun 20, 2012 at 7:05 AM, Jim Idle <jimi at temporal-wave.com>
>>> wrote:
>>>
>>> You are probably using the wrong Maven plugin. Find the docs in the wiki
>>> and it will tell you the correct name,
>>>
>>> JIm
>>>
>>>
>>> -----Original Message-----
>>> From: antlr-interest-bounces at antlr.org
>>> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Brad Cox
>>> Sent: Wednesday, June 20, 2012 6:48 PM
>>> To: Terence Parr; ANTLR interest; stringtemplate-interest at antlr.org List
>>> Subject: [antlr-interest] Antlr3 in Eclipse and Maven?
>>>
>>> I've an antlr3 grammar that compiles fine in AntlrWorks. I'm trying to
>>> load it into Eclipse with Maven to start work on the non-grammar bits.
>>>
>>> Problem is it won't compile in either. Error flags are on the first line,
>>> grammar ...;, and nothing I've tried will remove them. Somehow antlr2 is
>>> getting involved in the compile step.
>>>
>>> The dependency list shows antlr-runtime-3.2.jar and
>>> stringtemplate-3.2.jar
>>> now. Previously there was an antlr2 jar that I've explicitly excluded.
>>> Didn't make a difference.
>>>
>>> My best guess is that the antlr3 maven plugin is launching antlr2, not
>>> antlr3, but I have no visibility into what that plugin is doing.
>>>
>>> <groupId>org.antlr</groupId>
>>> <artifactId>antlr3-maven-plugin</artifactId>
>>> <version>3.1.3-1</version
>>>
>>> There's also likely confusion over which eclipse plugin I should be
>>> using.
>>> After some searching I removed everything but the one from certiv, but no
>>> joy.
>>>
>>> Could someone point me to a known-to-work reference? Thanks!
>>>
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Cell: 703-594-1883
>>> Blog: http://bradjcox.blogspot.com
>>> Web: http://virtualschool.edu
>>> Manassas VA 20111
>>>
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>>
>>
>>
>>
>> --
>> Cell: 703-594-1883
>> Blog: http://bradjcox.blogspot.com
>> Web: http://virtualschool.edu
>> Manassas VA 20111
>>
>>
>
>
> --
> Cell: 703-594-1883
> Blog: http://bradjcox.blogspot.com
> Web: http://virtualschool.edu
> Manassas VA 20111
>
>


-- 
Cell: 703-594-1883
Blog: http://bradjcox.blogspot.com
Web: http://virtualschool.edu
Manassas VA 20111


More information about the antlr-interest mailing list