从ActionScript target of ANTLR 3.3 is buggy开始,我尝试编译ANTLR 3.3来修复BUILD.txt和here中解释的Actionscript运行时目标。
安装Maven,设置路径,并按照说明编译ANTLR。
虽然我实际上可以使用mvn创建像gunit这样的子项目,但我无法构建ANTLR文件夹。
我调用ANTLR分发根文件夹中的mvn,得到如下结果:
[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虽然发行版不包含antlr3-maven-archetype文件夹,但它包含一个类似的文件夹antlr3-maven-plugin。
由于BUILD.txt声明构建ANTLR是微不足道的,我想知道,我忘了执行一个微不足道的步骤;-)
有人能帮上忙吗?
**更新-1**
使用以下说明:https://fisheye2.atlassian.com/browse/~raw,r=7250/antlr/BUILD.txt
下面是我所做的:
下载的Maven
将Maven添加到路径
export PATH=/Users/sp2/Desktop/antlrtst/maven/bin/:$PATH在主分发目录中运行此程序
mvn -N install报告这些问题
[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..。但最后的报告
BUILD SUCCESS然后,我执行了以下代码
mvn -Dmaven.test.skip=true。。开始报告问题的
[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..。将运行时添加到存储库
[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..。尝试构建
[INFO] ------------------------------------------------------------------------
[INFO] Building ANTLR Grammar Tool 3.3
[INFO] ------------------------------------------------------------------------..。最终会报告这个
[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
...。。最后,在57个错误之后
[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] ------------------------------------------------------------------------太可惜了。我真的很奇怪,为什么这些东西会变得如此复杂。
发布于 2011-06-26 11:21:03
我自己也试过。得到相同的错误。
注释父pom.xml中有问题的模块
<!--module>antlr3-maven-archetype</module-->构建成功。
不确定您的需求,但希望您仍然可以通过此解决方法实现它。
编辑1:您可以安全地忽略所有警告(与版本相关),这些警告是由于使用maven3运行maven2 pom而导致的。
但是,您不应该收到此错误:
找不到用户错误文件:文件“/Users/sp2/
/antlrtst/antlr-3\f25-3\f6
此文件存在于源代码发行版中。有趣的是,您的文件夹显示为"antlr-3.2.3",而其他邮件则与3.3相关。会不会是你的源码不正确/缺失?
https://stackoverflow.com/questions/6480598
复制相似问题