[antlr-interest] Maven Plugin failing with exception with missing antlr/TokenStream

Keeble, Paul (London)(c) pkeeble at maninvestments.com
Tue Oct 26 01:56:57 PDT 2010


To get started with ANTLR in Maven I used the archetype generation as
documented in
http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+Projects+with+Ma
ven. Unfortunately when I run mvn install I am receiving an error as
shown below. I also followed the instructions on
http://antlr.org/antlr3-maven-plugin/index.html and I get the exact same
error. The version I am using is 3.2 of both the runtime and the plugin.

I have tried a few things to attempt to resolve this:
- 3.1.x versions of the plugin and runtime in various combinations
including matching ones, same exception.
- Added version 2.7.7 as a dependency (antlr:antlr:2.7.7) but I'm not
sure that is adding it to the classpath of the plugin, its just adding
it as a dependency of the project.


[FATAL ERROR] org.antlr.mojo.antlr3.Antlr3Mojo#execute() caused a
linkage error (java.lang.NoClassDefFoundError) and may be out-of-date.
Check the rea
lms:
[FATAL ERROR] Plugin realm =
app0.child-container[org.antlr:antlr3-maven-plugin:3.2]
urls[0] =
file:/c:/projects/local-repository/org/antlr/antlr3-maven-plugin/3.2/ant
lr3-maven-plugin-3.2.jar
urls[1] =
file:/c:/projects/local-repository/org/codehaus/plexus/plexus-utils/1.1/
plexus-utils-1.1.jar
urls[2] =
file:/c:/projects/local-repository/org/codehaus/plexus/plexus-compiler-a
pi/1.5.3/plexus-compiler-api-1.5.3.jar
urls[3] =
file:/c:/projects/local-repository/org/antlr/antlr/3.2/antlr-3.2.jar
urls[4] =
file:/c:/projects/local-repository/org/antlr/antlr-runtime/3.2/antlr-run
time-3.2.jar
urls[5] =
file:/c:/projects/local-repository/org/antlr/stringtemplate/3.2/stringte
mplate-3.2.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/C:/devtools/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] antlr/TokenStream
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: antlr/TokenStream
        at org.antlr.tool.ErrorManager.setLocale(ErrorManager.java:421)
        at org.antlr.tool.ErrorManager.<clinit>(ErrorManager.java:383)
        at org.antlr.Tool.setMessageFormat(Tool.java:1222)
        at org.antlr.mojo.antlr3.Antlr3Mojo.execute(Antlr3Mojo.java:336)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:694)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:180)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


Any help much appreciated

Paul Keeble

**********************************************************************
 Please consider the environment before printing this email or its attachments.
The contents of this email are for the named addressees only.  It contains information which may be confidential and privileged.  If you are not the intended recipient, please notify the sender immediately, destroy this email and any attachments and do not otherwise disclose or use them. Email transmission is not a secure method of communication and Man Investments cannot accept responsibility for the completeness or accuracy of this email or any attachments. Whilst Man Investments makes every effort to keep its network free from viruses, it does not accept responsibility for any computer virus which might be transferred by way of this email or any attachments. This email does not constitute a request, offer, recommendation or solicitation of any kind to buy, subscribe, sell or redeem any investment instruments or to perform other such transactions of any kind. Man Investments reserves the right to monitor, record and retain all electronic communications through its network to ensure the integrity of its systems, for record keeping and regulatory purposes. 
Visit us at: www.maninvestments.com 
TG0908
**********************************************************************



More information about the antlr-interest mailing list