Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Gradle构建失败:原因:org.Gradle.api.GradleException:jackson和其他库缺少SHA_Java_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Gradle - Fatal编程技术网 elasticsearch,gradle,Java,elasticsearch,Gradle" /> elasticsearch,gradle,Java,elasticsearch,Gradle" />

Java Gradle构建失败:原因:org.Gradle.api.GradleException:jackson和其他库缺少SHA

Java Gradle构建失败:原因:org.Gradle.api.GradleException:jackson和其他库缺少SHA,java,elasticsearch,gradle,Java,elasticsearch,Gradle,我正在用amazon opendistro为elasticsearch编写一个调度程序插件。我在使用新版本7.9.1时遇到了一些问题,确切地说,我在使用gradle构建构建项目时遇到了这个错误: Execution failed for task ':opendistro-job-scheduler-project-scheduler:dependencyLicenses'. > Missing SHA for jackson-databind-2.11.3.jar. Run "

我正在用amazon opendistro为elasticsearch编写一个调度程序插件。我在使用新版本7.9.1时遇到了一些问题,确切地说,我在使用gradle构建构建项目时遇到了这个错误:

Execution failed for task ':opendistro-job-scheduler-project-scheduler:dependencyLicenses'.
> Missing SHA for jackson-databind-2.11.3.jar. Run "gradle updateSHAs" to create them
我导入的每个库(如json或httpclient)都会出现此错误。如果我运行“gradle update SHAh”,我会得到以下信息:

Task 'SHAs' not found in root project 'opendistro-job-scheduler'.
有什么想法吗?这是我的gradle文件:

/*
 *   Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License").
 *   You may not use this file except in compliance with the License.
 *   A copy of the License is located at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   or in the "license" file accompanying this file. This file is distributed
 *   on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 *   express or implied. See the License for the specific language governing
 *   permissions and limitations under the License.
 */

apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.testclusters'

esplugin {
    name 'opendistro-job-scheduler-project-scheduler'
    description 'Sample plugin that extends OpenDistro JobSchedulerPlugin'
    classname 'com.example.opendistroforelasticsearch.jobscheduler.project.ChimeraSchedulerPlugin'
    extendedPlugins = ['opendistro-job-scheduler']
}

ext {
    projectSubstitutions = [:]
    licenseFile = rootProject.file('LICENSE.txt')
    noticeFile = rootProject.file('NOTICE.txt')
}

dependencies {
    compileOnly project(path: ":${rootProject.name}-spi", configuration: 'shadow')
    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
    implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.3'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
    implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.12'
    implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.10'

}

licenseHeaders.enabled = false
validateNebulaPom.enabled = false
testingConventions.enabled = false;

integTest.dependsOn(rootProject.assemble)
integTestRunner {
    systemProperty 'tests.security.manager', 'false'
}
testClusters.integTest {
    testDistribution = 'OSS'
    // need to install job-scheduler first, need to assemble job-scheduler first
    plugin file("${rootProject.getBuildDir()}/distributions/${rootProject.getName()}-${project.getVersion()}.zip")
}

// As of ES 7.7 the sample-extension-plugin is being added to the list of plugins for the testCluster during build before
// the job-scheduler plugin is causing build failures.
// The job-scheduler zip is added explicitly above but the sample-extension-plugin is added implicitly at some time during evaluation.
// Will need to do a deep dive to find out exactly what task adds the sample-extension-plugin and add job-scheduler there but a temporary hack is to
// reorder the plugins list after evaluation but prior to task execution when the plugins are installed.
afterEvaluate {
    testClusters.integTest.nodes.each { node ->
        def plugins = node.plugins
        def firstPlugin = plugins.get(0)
        if (firstPlugin.provider == project.bundlePlugin.archiveFile) {
            plugins.remove(0)
            plugins.add(firstPlugin)
        }
    }
}