Since the ActionScript target of ANTLR 3.3 is buggy, I tried to compile ANTLR 3.3 to fix the Actionscript runtime target as explained in BUILD.txt and here.
Installed Maven, set the PATH, and followed the instructions to compile ANTLR.
While I actually can make subprojects like gunit using mvn, I fail to build the ANTLR folder.
I call mvn in ANTLR distribution root folder, I get this:
[ERROR] Child module /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/antlr3-maven-archetype
of /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/pom.xml does not exist
While distribution doesn't contain a folder antlr3-maven-archetype, it contains a similar folder antlr3-maven-plugin.
Since BUILD.txt states that building ANTLR is trivial, I wonder, I forgot to perform a trivial step ;-)
Could someone assist?
**UPDATE-1 **
Using these instructions: https://fisheye2.atlassian.com/browse/~raw,r=7250/antlr/BUILD.txt
Here is what I did:
Downloaded Maven
Added Maven to path
export PATH=/Users/sp2/Desktop/antlrtst/maven/bin/:$PATH
Running this in the main distribution directory
mvn -N install
Reports these problems
[WARNING] Some problems were encountered while building the effective model for org.antlr:antlr-master:pom:3.3
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 179, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 188, column 21
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin is missing. @ line 192, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 250, column 14
... but finally reports
BUILD SUCCESS
开发者_如何学JAVA
Then, I executed this
mvn -Dmaven.test.skip=true
.. which begins to report problems
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.antlr:antlr-runtime:jar:3.3
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ org.antlr:antlr-master:3.3, /Users/sp2/.m2/repository/org/antlr/antlr-master/3.3/antlr-master-3.3.pom, line 188, column 21
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin is missing. @ line 1, column 3642
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ org.antlr:antlr-master:3.3, /Users/sp2/.m2/repository/org/antlr/antlr-master/3.3/antlr-master-3.3.pom, line 250, column 14
... adds runtime to repo
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ antlr-runtime ---
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/target/antlr-runtime-3.3.jar to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3.jar
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/pom.xml to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3.pom
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/target/antlr-runtime-3.3-sources.jar to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3-sources.jar
... tries to build
[INFO] ------------------------------------------------------------------------
[INFO] Building ANTLR Grammar Tool 3.3
[INFO] ------------------------------------------------------------------------
... eventually reports this
[INFO] --- antlr-maven-plugin:2.2:generate (default) @ antlr ---
[INFO] grammar [antlr.g] was up-to-date; skipping
[INFO] performing grammar generation [codegen.g]
ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
**error**: file "/Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/antlr2/org/antlr/grammar/v2/codegen.g" not found
[INFO] performing grammar generation [antlr.print.g]
...and this
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ antlr ---
[INFO] Compiling 97 source files to /Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/target/classes
[INFO] -------------------------------------------------------------
**[ERROR] COMPILATION ERROR :**
[INFO] -------------------------------------------------------------
[ERROR] /Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/java/org/antlr/codegen/CodeGenerator.java:[37,27] cannot find symbol
symbol : class CodeGenTreeWalker
...
.. and finally this after 57 errors
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ANTLR Master build control POM .................... SUCCESS [0.912s]
[INFO] Antlr 3 Runtime ................................... SUCCESS [1.463s]
[INFO] ANTLR Grammar Tool ................................ **FAILURE** [7.275s]
[INFO] Maven plugin for ANTLR V3 ......................... SKIPPED
[INFO] ANTLR gUnit ....................................... SKIPPED
[INFO] Maven plugin for gUnit ANTLR V3 ................... SKIPPED
[INFO] ------------------------------------------------------------------------
Too bad. I really wonder, why this stuff tends to be that complicated...
Tried this myself. Got the same error.
Commented the offending module in the parent pom.xml
<!--module>antlr3-maven-archetype</module-->
Built successfully.
Not sure about your requirement, but hopefully you may still achieve it with this workaround.
Edit 1: You can safely ignore all the warnings (related to versions), which are due to running a maven2 pom with maven3.
However you should not be getting this error:
error: file "/Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/antlr2/org/antlr/grammar/v2/codegen.g" not found
This file exists in the source distribution. Interestingly your folder shows "antlr-3.2.3", while other messages are related to 3.3. Could it be that you have incorrect/missing source?
精彩评论