首页 > 解决方案 > gradle 中无法识别 antlr 插件

问题描述

我在 gradle 插件中添加了 antlr 但它不起作用

plugins {
    id "antlr"
    id 'war'
    id "org.gretty" version "3.0.1"
}

dependencies {
    // This dependency is used by the application.
    compile 'com.google.guava:guava:28.1-jre'
    compile 'javax.servlet:jstl:1.2'
    antlr   "org.antlr:antlr4:4.8"
}

但是当我运行 gradle 任务时它没有出现

标签: javagradlebuild.gradleantlrantlr4

解决方案


如果我理解你的问题,你需要输入

gradle tasks --all

然后你会在“其他任务”下找到鹿角任务。

...
generateGrammarSource - Processes the main Antlr grammars.
generateTestGrammarSource - Processes the test Antlr grammars.
...

Gradle CLI 文档中有更多信息。


推荐阅读