Proleap COBOL Parser与antlr4-runtime 13兼容版本及依赖问题咨询
Proleap Cobol Parser与antlr4-runtime兼容版本解决方案
问题根源
Proleap Cobol Parser的每个版本都绑定了特定版本的antlr4-runtime:
- 自动引入的antlr4-runtime 13与Proleap Cobol Parser 4.7.2编译时依赖的ATN序列化版本不匹配,触发
java.io.InvalidClassException - 强制降级到antlr4-runtime 4.7.2会因版本差异出现方法不可访问的兼容性问题
正确兼容版本组合
Proleap Cobol Parser 4.7.2 对应的官方兼容antlr4-runtime版本为4.9.3
修正后的依赖管理配置
替换原配置为:
<dependencyManagement> <dependencies> <dependency> <groupId>org.antlr</groupId> <artifactId>antlr4-runtime</artifactId> <version>4.9.3</version> <scope>runtime</scope> </dependency> </dependencies> </dependencyManagement>
验证依据
Proleap Cobol Parser 4.7.2的官方构建配置中明确依赖antlr4-runtime 4.9.3,使用该版本可同时解决ATN反序列化错误和方法兼容性问题。
内容的提问来源于stack exchange,提问作者Ashish Gupta
相关产品推荐
相关产品推荐

