gradle构建失败:原因:org.gradle.api.gradleexception:jackson和其他库缺少sha

bvuwiixz  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(0)|浏览(896)

我正在用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'.

你知道吗?这是我的毕业档案:

/*
 *   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)
        }
    }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题