zoukankan      html  css  js  c++  java
  • gradle构建java编写的logstash插件错误No signature of method: org.gradle.api.internal.tasks.DefaultTaskDependency

    [root@VM_63_147_centos logstash-input-java_input_example]# ./gradlew gem
    Starting a Gradle Daemon (subsequent builds will be faster)
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/data/logstash-input-java_input_example/build.gradle' line: 101
    
    * What went wrong:
    A problem occurred configuring root project 'logstash-input-java_input_example'.
    > Could not create task ':gem'.
       > No signature of method: org.gradle.api.internal.tasks.DefaultTaskDependency$TaskDependencySet.getAt() is applicable for argument types: (ArrayList) values: [[task ':downloadAndInstallJRuby', task ':removeObsoleteJars', ...]]
         Possible solutions: getAt(int), getAt(java.lang.String), getAt(java.lang.String), head(), putAt(java.lang.String, java.lang.Object), wait()
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 12s

    官网教程:https://www.elastic.co/guide/en/logstash/current/java-input-plugin.html

    官网下载的logstash 最新版源码:https://github.com/elastic/logstash/tree/7.10

    构建logstash源码:

    gradlew assemble

    查看是否有:$LS_HOMElogstash-coreuildlibslogstash-core-7.10.1.jar

    编写Logstash Java input代码

    下载官方demo:logstash input example:https://github.com/logstash-plugins/logstash-input-java_input_example

    指定LOGSTASH_CORE_PATH
    下载下来demo后,在项目根目录创建gradle.properties文件,

    添加一行数据: LOGSTASH_CORE_PATH=<执行gradlew assemble 后logstash编译出来的核心jar包>/logstash-core

    gradlew gem 

    在此处出现错误:No signature of method: org.gradle.api.internal

    编辑 build.gradle 

    tasks.register("gem"){
        dependsOn [downloadAndInstallJRuby, removeObsoleteJars, vendor, generateRubySupportFiles]
        doLast {
            buildGem(projectDir, buildDir, pluginInfo.pluginFullName() + ".gemspec")
        }
    }
    
    ################上面修改为########################
    tasks.register("gem"){
        dependsOn ([downloadAndInstallJRuby, removeObsoleteJars, vendor, generateRubySupportFiles])
        doLast {
            buildGem(projectDir, buildDir, pluginInfo.pluginFullName() + ".gemspec")
        }
    }  

    这样gradle就能识别了

  • 相关阅读:
    Centos系统下载
    Centos7 安装 docker
    Centos6 安装 docker
    yum提示Another app is currently holding the yum lock; waiting for it to exit...
    Oracle 时间字段显示不正确,类型错误
    Android 报错:error: too many padding sections on bottom border
    vs文件上传失败--超过最大字符限制
    ButterKnife 牛油刀使用
    VS项目发布到本地IIS
    Visual Studio无法调试
  • 原文地址:https://www.cnblogs.com/shiqi17/p/14144059.html
Copyright © 2011-2022 走看看