gpt4 book ai didi

java - "gradle init"(v4.0)生成的build.gradle找不到包

转载 作者:行者123 更新时间:2023-12-02 12:48:26 24 4
gpt4 key购买 nike

我使用“gradle init”将一个工作 Maven 项目转换为 Gradle。我收到包不存在错误。我不知道如何调试这个错误。

$ ./gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :drill-logical:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/home/drill/logical/src/main/java/org/apache/drill/common/expression/LogicalExpression.java:26: error: package org.apache.drill.common.expression.parser does not exist
import org.apache.drill.common.expression.parser.ExprLexer;
^
/home/drill/logical/src/main/java/org/apache/drill/common/expression/LogicalExpression.java:27: error: package org.apache.drill.common.expression.parser does not exist
import org.apache.drill.common.expression.parser.ExprParser;
^
/home/drill/logical/src/main/java/org/apache/drill/common/expression/LogicalExpression.java:28: error: package org.apache.drill.common.expression.parser.ExprParser does not exist
import org.apache.drill.common.expression.parser.ExprParser.parse_return;
^
/home/drill/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java:29: error: package org.apache.drill.common.expression.parser does not exist
import org.apache.drill.common.expression.parser.ExprLexer;
^
/home/drill/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java:30: error: package org.apache.drill.common.expression.parser does not exist
import org.apache.drill.common.expression.parser.ExprParser;
^
/home/drill/logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java:31: error: package org.apache.drill.common.expression.parser.ExprParser does not exist
import org.apache.drill.common.expression.parser.ExprParser.parse_return;
^

drill/逻辑目录下的build.gradle:

 $ cat build.gradle

description = 'Logical Plan, Base expressions'
dependencies {
compile project(':drill-protocol')
compile project(':drill-common')
compile(group: 'org.apache.calcite', name: 'calcite-core', version:'1.4.0-drill-r21') {
exclude(module: 'jgrapht-jdk1.5')
exclude(module: 'commons-logging')
exclude(module: 'jackson-annotations')
exclude(module: 'jackson-core')
exclude(module: 'jackson-databind')
}

compile group: 'com.typesafe', name: 'config', version:'1.0.0'
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.1'
compile group: 'org.msgpack', name: 'msgpack', version:'0.6.6'
compile group: 'org.reflections', name: 'reflections', version:'0.9.8'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.7.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.7.1'
compile group: 'com.codahale.metrics', name: 'metrics-core', version:'3.0.1'
compile group: 'com.codahale.metrics', name: 'metrics-servlets', version:'3.0.1'
compile group: 'org.antlr', name: 'antlr-runtime', version:'3.4'
compile group: 'joda-time', name: 'joda-time', version:'2.9'

testCompile project(':drill-common')
}

task packageTests(type: Jar) {
from sourceSets.test.output
classifier = 'tests'
}

我是否查看了错误的 build.gradle 文件?最上面的 build.gradle 列出了与其 pom.xml 一对一匹配的依赖项和存储库。

我应该寻找什么?

最佳答案

您缺少的类是由 ANTLR 生成的。您的存储库中有一个 ANTLR 语法文件,这些源是从该文件生成的。与 Maven 构建中使用的大多数插件一样,这不会自动传输到 Gradle,而是必须手动完成。使用内置的 Gradle ANTLR 插件从语法文件生成源代码。

关于java - "gradle init"(v4.0)生成的build.gradle找不到包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44660248/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com