Difference between revisions of "ANTLR maven plugin"

From BITPlan Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
As of 2017-10-22 [https://mvnrepository.com/artifact/org.antlr/antlr4-maven-plugin/4.7 ANTLR Maven plugin 4.7] is the
 
As of 2017-10-22 [https://mvnrepository.com/artifact/org.antlr/antlr4-maven-plugin/4.7 ANTLR Maven plugin 4.7] is the
 
latest version of the ANTLR Maven plugin.
 
latest version of the ANTLR Maven plugin.
 +
 
The [https://mvnrepository.com/artifact/org.antlr/antlr4-maven-plugin available versions of the ANTLR Maven plugin] started with Version 4.0 in January 2013.
 
The [https://mvnrepository.com/artifact/org.antlr/antlr4-maven-plugin available versions of the ANTLR Maven plugin] started with Version 4.0 in January 2013.
  
 +
The [http://www.antlr.org/api/maven-plugin/latest/ documentation on www.antlr.org] is at Version 4.5 at the time of writing this article.
 +
 +
== maven build-helper ==
 
* http://www.mojohaus.org/build-helper-maven-plugin/usage.html
 
* http://www.mojohaus.org/build-helper-maven-plugin/usage.html
 +
 +
= Example pom.xml configurations =
 +
<source lang='xml'>
 +
<!-- automate antlr grammar handling -->
 +
<plugin>
 +
<groupId>org.antlr</groupId>
 +
<artifactId>antlr4-maven-plugin</artifactId>
 +
<version>4.7</version>
 +
<configuration>
 +
<!-- basically this is the default setting -->
 +
<sourceDirectory>src/main/antlr4</sourceDirectory>
 +
<libDirectory>target/generated-sources/antlr4</libDirectory>
 +
</configuration>
 +
<executions>
 +
<execution>
 +
<id>antlr</id>
 +
<goals>
 +
<goal>antlr4</goal>
 +
</goals>
 +
</execution>
 +
</executions>
 +
</plugin>
 +
</source>
 +
* https://github.com/antlr/grammars-v4/blob/master/antlr4/pom.xml
 +
* https://gist.github.com/sharwell/4979017
 +
[[Category:ANTLR]]

Latest revision as of 14:14, 22 October 2017

This article is motivated by ANTLR Issue 2061- reference to undefined rule - useability of import and maven setup for it.

As of 2017-10-22 ANTLR Maven plugin 4.7 is the latest version of the ANTLR Maven plugin.

The available versions of the ANTLR Maven plugin started with Version 4.0 in January 2013.

The documentation on www.antlr.org is at Version 4.5 at the time of writing this article.

maven build-helper

Example pom.xml configurations

<!-- automate antlr grammar handling -->
			<plugin>
				<groupId>org.antlr</groupId>
				<artifactId>antlr4-maven-plugin</artifactId>
				<version>4.7</version>
				<configuration>
					<!-- basically this is the default setting -->
					<sourceDirectory>src/main/antlr4</sourceDirectory>
					<libDirectory>target/generated-sources/antlr4</libDirectory>
				</configuration>
				<executions>
					<execution>
						<id>antlr</id>
						<goals>
							<goal>antlr4</goal>
						</goals>
					</execution>
				</executions>
			</plugin>