New ANTLRv4 Maven Plugin

976 views
Skip to first unread message

Hans Uhlig

unread,
Nov 30, 2012, 5:40:35 PM11/30/12
to antlr-di...@googlegroups.com
I got a bit frustrated trying to clean up and convert the existing maven plugin so I went back and started from scratch. 


Available here, it currently exposes all of the options inside maven and I fixed the null directory problem. I am fully open to feedback and happy to donate the code and rights over to ANTLR

Terence Parr

unread,
Nov 30, 2012, 7:37:11 PM11/30/12
to antlr-di...@googlegroups.com
Sam, is Hans' plugin better? can we bring that in or should we tweak the existing?
T
> --
>
>

Sam Harwell

unread,
Nov 30, 2012, 8:49:22 PM11/30/12
to antlr-di...@googlegroups.com
I should get to this one in detail this weekend.

--
Sam Harwell
Owner, Lead Developer
http://tunnelvisionlabs.com
--




Hans Uhlig

unread,
Nov 30, 2012, 8:57:04 PM11/30/12
to antlr-di...@googlegroups.com
I am working to see if I can add a second task for Testrig and some level of automated testing.

Sam Harwell

unread,
Dec 1, 2012, 5:18:00 PM12/1/12
to antlr-di...@googlegroups.com

Hi Hans,

 

I just checked in a major update to the Maven plugin. Its usage is substantially simplified, and offers the following advantages over other implementations:

 

·         Several unused and/or non-functional options were removed.

·         Several configuration options may be overridden by setting properties like antlr4.listener, antlr4.visitor, etc. in a pom.xml or on the Maven command line.

·         An “arguments” property is available for appending arbitrary arguments to the tool command line. This allowed me to remove some rarely used parameters and makes sure the Maven plugin still works if/when the tool is modified in the future.

·         The -package option is automatically derived from grammar paths, and calls to the tool are batched to ensure it’s always correct. You no longer have to specify a package in the grammar (in fact, doing so in a @header{} block would break the build).

 

--

Sam Harwell

Owner, Lead Developer

http://tunnelvisionlabs.com

 

--
 
 

Hans Uhlig

unread,
Dec 1, 2012, 11:33:02 PM12/1/12
to antlr-di...@googlegroups.com
Has this been pushed out to sonatype?

Hans Uhlig

unread,
Dec 1, 2012, 11:39:13 PM12/1/12
to antlr-di...@googlegroups.com
Also are you planning a new version of gunit for antlr4 or another way of unit testing grammars?

Terence Parr

unread,
Dec 2, 2012, 12:24:07 PM12/2/12
to antlr-di...@googlegroups.com
Hi. we've abandoned gunit since pure java code looks almost as good as gunit tests.
ter
> --
>
>

Sam Harwell

unread,
Dec 2, 2012, 2:11:14 PM12/2/12
to antlr-di...@googlegroups.com

I just updated the 4.0-SNAPSHOT artifact.

 

--

Sam Harwell

Owner, Lead Developer

http://tunnelvisionlabs.com

 

From: antlr-di...@googlegroups.com [mailto:antlr-di...@googlegroups.com] On Behalf Of Hans Uhlig


Sent: Saturday, December 01, 2012 10:33 PM
To: antlr-di...@googlegroups.com

--
 
 

Hans Uhlig

unread,
Dec 2, 2012, 4:00:01 PM12/2/12
to antlr-di...@googlegroups.com
Ok, I cleared and got the new maven plugin. It doesn't seem to run. Perhaps I am doing something wrong. 

what is the goal to call it explicitly?

Sam Harwell

unread,
Dec 2, 2012, 5:33:01 PM12/2/12
to antlr-di...@googlegroups.com

Hi Hans,

 

For a minimal setup you can start with the following. Grammars will be compiled as part of the normal build process.

 

<plugin>
  <groupId>org.antlr</groupId>
  <artifactId>antlr4-maven-plugin</artifactId>
  <version>4.0-SNAPSHOT</version>
  <executions>
    <execution>
      <goals>
        <goal>antlr</goal>
      </goals>
      <configuration>
        <!-- Include this line if you place your .g4 files in the same root folder as your Java source files. -->
        <!--<sourceDirectory>${basedir}/src/main/java</sourceDirectory>-->
      </configuration>
    </execution>
  </executions>
</plugin>

--
 
 

Hans Uhlig

unread,
Dec 2, 2012, 5:38:27 PM12/2/12
to antlr-di...@googlegroups.com
back to the same problem as before. The plugin is always resolving the relative directory to null.

github.com/huhlig/essex

cd C:\Users\huhlig\Dropbox\Projects\Essex; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_07" C:\\Users\\huhlig\\AppData\\Roaming\\NetBeans\\7.2\\maven\\bin\\mvn.bat -X clean compile
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
Maven home: C:\Users\huhlig\AppData\Roaming\NetBeans\7.2\maven
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_07\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Error stacktraces are turned on.
Reading global settings from C:\Users\huhlig\AppData\Roaming\NetBeans\7.2\maven\conf\settings.xml
Reading user settings from C:\Users\huhlig\.m2\settings.xml
Using local repository at C:\Users\huhlig\.m2\repository
Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\huhlig\.m2\repository
Scanning for projects...
Extension realms for project com.uhlisys.essex:parser:jar:0.0.1-SNAPSHOT: (none)
Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
=== REACTOR BUILD PLAN ================================================
Project: com.uhlisys.essex:parser:jar:0.0.1-SNAPSHOT
Tasks:   [clean, compile]
Style:   Regular
=======================================================================
                                                                        
------------------------------------------------------------------------
Building Essex 0.0.1-SNAPSHOT
------------------------------------------------------------------------
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
Could not find metadata org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Could not find metadata org.antlr:project:4.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:project:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
Lifecycle clean -> [pre-clean, clean, post-clean]
Lifecycle site -> [pre-site, site, post-site, site-deploy]
=== PROJECT BUILD PLAN ================================================
Project:       com.uhlisys.essex:parser:0.0.1-SNAPSHOT
Dependencies (collect): []
Dependencies (resolve): [compile]
Repositories (dependencies): [sonatype-snapshots (https://oss.sonatype.org/content/repositories/snapshots, releases+snapshots), central (http://repo.maven.apache.org/maven2, releases)]
Repositories (plugins)     : [sonatype-snapshots (https://oss.sonatype.org/content/repositories/snapshots/, releases+snapshots), central (http://repo.maven.apache.org/maven2, releases)]
-----------------------------------------------------------------------
Goal:          org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)
Style:         Regular
Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <directory default-value="${project.build.directory}"/>
  <excludeDefaultDirectories default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
  <failOnError default-value="true">${maven.clean.failOnError}</failOnError>
  <followSymLinks default-value="false">${clean.followSymLinks}</followSymLinks>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <reportDirectory default-value="${project.reporting.outputDirectory}"/>
  <skip default-value="false">${clean.skip}</skip>
  <testOutputDirectory default-value="${project.build.testOutputDirectory}"/>
  <verbose>${clean.verbose}</verbose>
</configuration>
-----------------------------------------------------------------------
Goal:          org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT:antlr (default)
Style:         Regular
Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <atn default-value="false">${antlr4.atn}</atn>
  <forceATN default-value="false">${antlr4.forceATN}</forceATN>
  <libDirectory default-value="${basedir}/src/main/antlr4/imports"/>
  <listener default-value="true">${antlr4.listener}</listener>
  <outputDirectory default-value="${project.build.directory}/generated-sources/antlr4"/>
  <project>${project}</project>
  <sourceDirectory default-value="${basedir}/src/main/antlr4"/>
  <treatWarningsAsErrors default-value="false">${antlr4.treatWarningsAsErrors}</treatWarningsAsErrors>
  <visitor default-value="false">${antlr4.visitor}</visitor>
</configuration>
-----------------------------------------------------------------------
Goal:          org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources)
Style:         Regular
Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <buildFilters default-value="${project.build.filters}"/>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <escapeString>${maven.resources.escapeString}</escapeString>
  <escapeWindowsPaths default-value="true">${maven.resources.escapeWindowsPaths}</escapeWindowsPaths>
  <includeEmptyDirs default-value="false">${maven.resources.includeEmptyDirs}</includeEmptyDirs>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <overwrite default-value="false">${maven.resources.overwrite}</overwrite>
  <project default-value="${project}"/>
  <resources default-value="${project.resources}"/>
  <session default-value="${session}"/>
  <supportMultiLineFiltering default-value="false">${maven.resources.supportMultiLineFiltering}</supportMultiLineFiltering>
  <useBuildFilters default-value="true"/>
  <useDefaultDelimiters default-value="true"/>
</configuration>
-----------------------------------------------------------------------
Goal:          org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile)
Style:         Regular
Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <basedir default-value="${basedir}"/>
  <buildDirectory default-value="${project.build.directory}"/>
  <classpathElements default-value="${project.compileClasspathElements}"/>
  <compileSourceRoots default-value="${project.compileSourceRoots}"/>
  <compilerId default-value="javac">${maven.compiler.compilerId}</compilerId>
  <compilerReuseStrategy default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}</compilerReuseStrategy>
  <compilerVersion>${maven.compiler.compilerVersion}</compilerVersion>
  <debug default-value="true">${maven.compiler.debug}</debug>
  <debuglevel>${maven.compiler.debuglevel}</debuglevel>
  <encoding default-value="${project.build.sourceEncoding}">${encoding}</encoding>
  <executable>${maven.compiler.executable}</executable>
  <failOnError default-value="true">${maven.compiler.failOnError}</failOnError>
  <forceJavacCompilerUse default-value="false">${maven.compiler.forceJavacCompilerUse}</forceJavacCompilerUse>
  <fork default-value="false">true</fork>
  <generatedSourcesDirectory default-value="${project.build.directory}/generated-sources/annotations"/>
  <maxmem>2048m</maxmem>
  <meminitial>512m</meminitial>
  <mojoExecution>${mojoExecution}</mojoExecution>
  <optimize default-value="false">${maven.compiler.optimize}</optimize>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <projectArtifact default-value="${project.artifact}"/>
  <showDeprecation default-value="false">${maven.compiler.showDeprecation}</showDeprecation>
  <showWarnings default-value="false">${maven.compiler.showWarnings}</showWarnings>
  <skipMultiThreadWarning default-value="false">${maven.compiler.skipMultiThreadWarning}</skipMultiThreadWarning>
  <source default-value="1.5">1.7</source>
  <staleMillis default-value="0">${lastModGranularityMs}</staleMillis>
  <target default-value="1.5">1.7</target>
  <verbose default-value="false">${maven.compiler.verbose}</verbose>
  <mavenSession default-value="${session}"/>
  <session default-value="${session}"/>
</configuration>
=======================================================================
Could not find metadata org.antlr:antlr4-runtime:4.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr4-runtime:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
com.uhlisys.essex:parser:jar:0.0.1-SNAPSHOT
   junit:junit:jar:4.10:test
      org.hamcrest:hamcrest-core:jar:1.1:test
   commons-cli:commons-cli:jar:1.2:compile
   org.codehaus.groovy:groovy-all:jar:2.0.5:compile
   org.antlr:antlr4-runtime:jar:4.0-SNAPSHOT:compile
      org.abego.treelayout:org.abego.treelayout.core:jar:1.0.1:compile
   commons-logging:commons-logging-api:jar:1.0.4:compile

[clean:clean]
Created new class realm maven.api
Importing foreign packages into class realm maven.api
  Imported: org.apache.maven.wagon.events < plexus.core
  Imported: org.sonatype.aether.transfer < plexus.core
  Imported: org.apache.maven.exception < plexus.core
  Imported: org.sonatype.aether.metadata < plexus.core
  Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
  Imported: org.sonatype.aether.collection < plexus.core
  Imported: org.sonatype.aether.version < plexus.core
  Imported: org.apache.maven.monitor < plexus.core
  Imported: org.apache.maven.wagon.repository < plexus.core
  Imported: org.apache.maven.repository < plexus.core
  Imported: org.apache.maven.wagon.resource < plexus.core
  Imported: org.codehaus.plexus.logging < plexus.core
  Imported: org.apache.maven.profiles < plexus.core
  Imported: org.sonatype.aether.repository < plexus.core
  Imported: org.apache.maven.classrealm < plexus.core
  Imported: org.apache.maven.execution < plexus.core
  Imported: org.sonatype.aether.artifact < plexus.core
  Imported: org.sonatype.aether.spi < plexus.core
  Imported: org.apache.maven.reporting < plexus.core
  Imported: org.apache.maven.usability < plexus.core
  Imported: org.codehaus.plexus.container < plexus.core
  Imported: org.codehaus.plexus.component < plexus.core
  Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
  Imported: org.apache.maven.wagon.authentication < plexus.core
  Imported: org.apache.maven.lifecycle < plexus.core
  Imported: org.codehaus.plexus.classworlds < plexus.core
  Imported: org.sonatype.aether.graph < plexus.core
  Imported: org.sonatype.aether.* < plexus.core
  Imported: org.apache.maven.settings < plexus.core
  Imported: org.codehaus.classworlds < plexus.core
  Imported: org.sonatype.aether.impl < plexus.core
  Imported: org.apache.maven.wagon.* < plexus.core
  Imported: org.apache.maven.toolchain < plexus.core
  Imported: org.sonatype.aether.deployment < plexus.core
  Imported: org.apache.maven.wagon.observers < plexus.core
  Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
  Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
  Imported: org.apache.maven.configuration < plexus.core
  Imported: org.apache.maven.cli < plexus.core
  Imported: org.sonatype.aether.installation < plexus.core
  Imported: org.codehaus.plexus.context < plexus.core
  Imported: org.apache.maven.wagon.authorization < plexus.core
  Imported: org.apache.maven.project < plexus.core
  Imported: org.apache.maven.rtinfo < plexus.core
  Imported: org.codehaus.plexus.lifecycle < plexus.core
  Imported: org.codehaus.plexus.configuration < plexus.core
  Imported: org.apache.maven.artifact < plexus.core
  Imported: org.apache.maven.model < plexus.core
  Imported: org.apache.maven.* < plexus.core
  Imported: org.apache.maven.wagon.proxy < plexus.core
  Imported: org.sonatype.aether.resolution < plexus.core
  Imported: org.apache.maven.plugin < plexus.core
  Imported: org.codehaus.plexus.* < plexus.core
  Imported: org.codehaus.plexus.personality < plexus.core
Populating class realm maven.api
org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
   org.apache.maven:maven-plugin-api:jar:2.0.6:compile
   org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
Created new class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
  Imported:  < maven.api
Populating class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
  Included: org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
  Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
  Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1, parent: sun.misc.Launcher$AppClassLoader@c22b29a]
Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean' with basic configurator -->
  (f) directory = C:\Users\huhlig\Dropbox\Projects\Essex\target
  (f) excludeDefaultDirectories = false
  (f) failOnError = true
  (f) followSymLinks = false
  (f) outputDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\target\classes
  (f) reportDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\target\site
  (f) skip = false
  (f) testOutputDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\target\test-classes
-- end configuration --
Deleting C:\Users\huhlig\Dropbox\Projects\Essex\target
Deleting directory C:\Users\huhlig\Dropbox\Projects\Essex\target\generated-sources\antlr4
Deleting directory C:\Users\huhlig\Dropbox\Projects\Essex\target\generated-sources
Deleting directory C:\Users\huhlig\Dropbox\Projects\Essex\target
Skipping non-existing directory C:\Users\huhlig\Dropbox\Projects\Essex\target\classes
Skipping non-existing directory C:\Users\huhlig\Dropbox\Projects\Essex\target\test-classes
Skipping non-existing directory C:\Users\huhlig\Dropbox\Projects\Essex\target\site

[antlr4:antlr]
Could not find metadata org.antlr:antlr4:4.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr4:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Skipped remote update check for org.antlr:antlr4:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Could not find metadata org.antlr:antlr-runtime:3.5.1-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr-runtime:3.5.1-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Skipped remote update check for org.antlr:antlr-runtime:3.5.1-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Could not find metadata org.antlr:antlr-master:3.5.1-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr-master:3.5.1-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Skipped remote update check for org.antlr:antlr-master:3.5.1-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Could not find metadata org.antlr:ST4:4.0.7-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:ST4:4.0.7-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Skipped remote update check for org.antlr:ST4:4.0.7-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
org.antlr:antlr4-maven-plugin:jar:4.0-20121202.190858-3:
   org.apache.maven:maven-plugin-api:jar:3.0.4:compile
      org.apache.maven:maven-model:jar:3.0.4:compile
      org.apache.maven:maven-artifact:jar:3.0.4:compile
      org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
         org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
         org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
         org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
            org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
               org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
   org.apache.maven:maven-project:jar:2.2.1:compile
      org.apache.maven:maven-settings:jar:2.2.1:compile
      org.apache.maven:maven-profile:jar:2.2.1:compile
      org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
         org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
         backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
      org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
      org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
      org.codehaus.plexus:plexus-utils:jar:1.5.15:compile
      org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
         junit:junit:jar:3.8.1:compile
         classworlds:classworlds:jar:1.1-alpha-2:compile
   org.codehaus.plexus:plexus-compiler-api:jar:2.0:compile
   org.antlr:antlr4:jar:4.0-SNAPSHOT:compile
      org.antlr:antlr4-runtime:jar:4.0-SNAPSHOT:compile
         org.abego.treelayout:org.abego.treelayout.core:jar:1.0.1:compile
      org.antlr:antlr-runtime:jar:3.5.1-SNAPSHOT:compile
         org.antlr:stringtemplate:jar:3.2.1:compile
            antlr:antlr:jar:2.7.7:compile
      org.antlr:ST4:jar:4.0.7-SNAPSHOT:compile
Could not find metadata org.antlr:antlr4-runtime:4.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\huhlig\.m2\repository)
Skipped remote update check for org.antlr:antlr4-runtime:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Skipped remote update check for org.antlr:antlr4-runtime:4.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
Created new class realm plugin>org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT
Importing foreign packages into class realm plugin>org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT
  Imported:  < maven.api
Populating class realm plugin>org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT
  Included: org.antlr:antlr4-maven-plugin:jar:4.0-SNAPSHOT
  Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
  Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
  Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
  Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
  Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
  Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
  Included: org.codehaus.plexus:plexus-utils:jar:1.5.15
  Included: junit:junit:jar:3.8.1
  Included: org.codehaus.plexus:plexus-compiler-api:jar:2.0
  Included: org.antlr:antlr4:jar:4.0-SNAPSHOT
  Included: org.antlr:antlr4-runtime:jar:4.0-SNAPSHOT
  Included: org.abego.treelayout:org.abego.treelayout.core:jar:1.0.1
  Included: org.antlr:antlr-runtime:jar:3.5.1-SNAPSHOT
  Included: org.antlr:stringtemplate:jar:3.2.1
  Included: antlr:antlr:jar:2.7.7
  Included: org.antlr:ST4:jar:4.0.7-SNAPSHOT
  Excluded: org.apache.maven:maven-plugin-api:jar:3.0.4
  Excluded: org.apache.maven:maven-model:jar:3.0.4
  Excluded: org.apache.maven:maven-artifact:jar:3.0.4
  Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0
  Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.4
  Excluded: org.apache.maven:maven-project:jar:2.2.1
  Excluded: org.apache.maven:maven-settings:jar:2.2.1
  Excluded: org.apache.maven:maven-profile:jar:2.2.1
  Excluded: org.apache.maven:maven-artifact-manager:jar:2.2.1
  Excluded: org.apache.maven:maven-repository-metadata:jar:2.2.1
  Excluded: org.apache.maven:maven-plugin-registry:jar:2.2.1
  Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
  Excluded: classworlds:classworlds:jar:1.1-alpha-2
Configuring mojo org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT:antlr from plugin realm ClassRealm[plugin>org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT, parent: sun.misc.Launcher$AppClassLoader@c22b29a]
Configuring mojo 'org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT:antlr' with basic configurator -->
  (f) atn = false
  (f) forceATN = false
  (f) libDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4\imports
  (f) listener = true
  (f) outputDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\target\generated-sources\antlr4
  (f) project = MavenProject: com.uhlisys.essex:parser:0.0.1-SNAPSHOT @ C:\Users\huhlig\Dropbox\Projects\Essex\pom.xml
  (f) sourceDirectory = C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4
  (f) treatWarningsAsErrors = false
  (f) visitor = false
-- end configuration --
ANTLR: Output: C:\Users\huhlig\Dropbox\Projects\Essex\target\generated-sources\antlr4
ANTLR: Library: C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4\imports
Grammar file 'C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4\Essex.g4' detected.
  ... relative path is: null\Essex.g4
Output directory base will be C:\Users\huhlig\Dropbox\Projects\Essex\target\generated-sources\antlr4
ANTLR 4: Processing source directory C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4
Message{errorType=CANNOT_OPEN_FILE, args=[null\Essex.g4], e=java.io.FileNotFoundException: C:\Users\huhlig\Dropbox\Projects\Essex\src\main\antlr4\null\Essex.g4 (The system cannot find the path specified), fileName='null', line=-1, charPosition=-1}
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.607s
Finished at: Sun Dec 02 14:36:07 PST 2012
Final Memory: 6M/183M
------------------------------------------------------------------------
Failed to execute goal org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT:antlr (default) on project parser: ANTLR 4 caught 1 build errors. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.antlr:antlr4-maven-plugin:4.0-SNAPSHOT:antlr (default) on project parser: ANTLR 4 caught 1 build errors.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: ANTLR 4 caught 1 build errors.
at org.antlr.mojo.antlr4.Antlr4Mojo.execute(Antlr4Mojo.java:293)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more


For more information about the errors and possible solutions, please read the following articles:


Sam Harwell

unread,
Dec 2, 2012, 5:53:56 PM12/2/12
to antlr-di...@googlegroups.com

Hi Hans,

 

The error is happening because your grammar is located in the root of the project and not within a particular package.

 

I opened the following issue related to handling of files in the default package:

https://github.com/antlr/antlr4/issues/94

 

 

--

Sam Harwell

Owner, Lead Developer

http://tunnelvisionlabs.com

 

From: antlr-di...@googlegroups.com [mailto:antlr-di...@googlegroups.com] On Behalf Of Hans Uhlig


Sent: Sunday, December 02, 2012 4:38 PM
To: antlr-di...@googlegroups.com

--
 
 

Sam Harwell

unread,
Dec 2, 2012, 7:34:18 PM12/2/12
to antlr-di...@googlegroups.com

This issue is now fixed and I pushed the update to Sonatype.

 

--

Sam Harwell

Owner, Lead Developer

http://tunnelvisionlabs.com

 

--
 
 

Hans Uhlig

unread,
Dec 5, 2012, 6:41:05 PM12/5/12
to antlr-di...@googlegroups.com
Can you upload the antlr-runtime:jar:3.5.1-snapshot as it appears to be a dependency of the antlr4-maven-plugin

Sam Harwell

unread,
Dec 5, 2012, 7:39:59 PM12/5/12
to antlr-di...@googlegroups.com

I deployed a new 4.0-SNAPSHOT build of ANTLR 4 (including antlr4-maven-plugin), which now depends on the 3.5-rc-1 release of antlr-runtime in Maven Central.

 

P.S. 3.5.1 was an incorrect version number. The next release of ANTLR 3 will be 3.5. I removed all of the 3.5.1-SNAPSHOT builds from Sonatype for this reason.

 

--

Sam Harwell

Owner, Lead Developer

http://tunnelvisionlabs.com

 

From: antlr-di...@googlegroups.com [mailto:antlr-di...@googlegroups.com] On Behalf Of Hans Uhlig


Sent: Wednesday, December 05, 2012 5:41 PM
To: antlr-di...@googlegroups.com

--
 
 

Hans Uhlig

unread,
Dec 5, 2012, 7:47:43 PM12/5/12
to antlr-di...@googlegroups.com
That works! Thanks!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages