码迷,mamicode.com
首页 > 其他好文 > 详细

记一次antlr错误:ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.2ANTLR

时间:2019-10-08 14:43:02      阅读:1371      评论:0      收藏:0      [点我收藏+]

标签:bsp   execution   match   artifact   lex   too   好的   pat   for   

使用idea运行重构好的spark sql,在编译期出现如下错误:

ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.2ANTLR

原因:

<dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
</dependency>

点击进入依赖,看当前antlr4的底层的依赖:

<plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <version>4.5.3</version> <!-- use older version to process XPathLexer.g4, avoiding cyclic build dependency -->
                <executions>
                    <execution>
                        <id>antlr</id>
                        <configuration>
                            <sourceDirectory>src</sourceDirectory>
                        </configuration>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

这样就能对上错误问题了,因为使用4.7.2生成的代码。但是在编译期间是4.5.3;所以出错了

解决:

将4.5.3改成4.7即可

 

记一次antlr错误:ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.2ANTLR

标签:bsp   execution   match   artifact   lex   too   好的   pat   for   

原文地址:https://www.cnblogs.com/niutao/p/11634973.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!