[antlr-interest] antlr3-maven-plugin not generating sources

Tilman Bender tbender at stud.hs-heilbronn.de
Tue Jun 2 02:34:11 PDT 2009


Hi Timotheus,

I from what I can see your snippet from pom.xml is lacking an  
execution element.
I have a working example here (be careful, I use the SNAPSHOT)

<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr3-maven-plugin</artifactId>
<version>3.1.4-SNAPSHOT</version>
<configuration>
<libDirectory>target/generated-sources/antlr3/de/hshn/se/akse/ss09/ 
parser/</libDirectory>
<!--<debug>true</debug>-->
<!-- print some fancy information about the grammars-->
<report>true</report>
<!-- generated parser code will log rule entry and exit points to  
stdout as an aid to debugging.-->
<trace>true</trace>
<!--   generate a dot graph of the NFA for each rule -->
<!-- <nfa>true</nfa> -->
<!-- generate a dot graph of the DFA for each decision in the grammar  
-->
<!-- <dfa>true</dfa> -->

                                 </configuration>
                                 <executions>
                                         <execution>
                                                 <id>antlr</id>
                                                 <phase>generate- 
sources</phase>
                                                 <goals>
                                                         <goal>antlr</ 
goal>
                                                 </goals>
                                         </execution>
                                 </executions>
                         </plugin>

Tilman Bender
Student des Software Engineering
Hochschule Heilbronn
tbender at stud.hs-heilbronn.de



Am 02.06.2009 um 10:43 schrieb T Stotts:

>
> I have created a Java project managed by Maven 2 that includes Antlr 3
> grammar files. Following the instructions at:
>    http://antlr.org/antlr3-maven-plugin/index.html
> resulted in unexpected behavior.
>
> (1) Antlr is never invoked during the generate-sources or compile
> phases. The grammars are not processed.
>   # mvn compile
> or
>   # mvn package
> do not result in the generation of Antlr source, nor the compilation
> there of.
>
>
> (2) Manually invoking the plugin with:
>   # mvn mvn org.antlr:antlr3-maven-plugin:3.1.3-1:antlr
> does cause the grammar files to be processed, and the generated  
> sources
> to be placed under:
>   ./target/generated-sources/antlr3/
> However, there is no phase/rule to then compile these generated
> sources.
>
> My pom.xml contains:
>
>  <build>
>    <plugins>
>      ...
>
>      <plugin>
>        <groupId>org.antlr</groupId>
>        <artifactId>antlr3-maven-plugin</artifactId>
>        <version>3.1.3-1</version>
>        <executions>
>          <execution>
>            <configuration>
>              <goals>
>                <goal>antlr</goal>
>              </goals>
>              <verbose>true</verbose>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>
>      ...
>    </plugins>
>  </build>
>
> -- 
> aka:   timotheus
> web:   http://tstotts.net/
>
> 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/20090602/0f8ddaed/attachment.html 


More information about the antlr-interest mailing list