微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Gradle Build 问题:为 gobblin 设置运行 gradle clean build 时遇到问题

如何解决Gradle Build 问题:为 gobblin 设置运行 gradle clean build 时遇到问题

在构建 gradle 时,我面临以下问题。

由以下原因引起:org.gradle.api.plugins.UnkNownPluginException:未找到 ID 为“pegasus”的插件

我们可以在 Windows 中设置 gobblin 吗?如果是,那么哪个版本的 gobllin 和 gradle 适合设置?

我使用的是 apache gobblin - 0.14.0,Gradle 版本 - 6.5,Windows 10

错误

D:\Gobblin\Apache_Gobblin_GitHub\incubator-gobblin>gradlew clean build --stacktrace
Configuration on demand is an incubating feature.

> Configure project :
Build property: gobblinFlavor=standard
Build property: jdkVersion=1.8
Build property: sonatypeArtifactRepository=https://oss.sonatype.org/service/local/staging/deploy/maven2/
Build property: sonatypeArtifactSnapshotRepository=https://oss.sonatype.org/content/repositories/snapshots/
Build property: nexusArtifactRepository=https://repository.apache.org/service/local/staging/deploy/maven2
Build property: nexusArtifactSnapshotRepository=https://repository.apache.org/content/repositories/snapshots
Build property: doNotSignArtifacts=false
Build property: avroVersion=1.8.1
Build property: awsversion=1.11.8
Build property: bytemanVersion=4.0.5
Build property: confluentVersion=2.0.1
Build property: hadoopVersion=2.3.0
Build property: hiveVersion=1.0.1
Build property: kafka08Version=0.8.2.2
Build property: kafka09Version=0.9.0.1
Build property: kafka1Version=1.1.1
Build property: pegasusversion=29.6.4
Build property: salesforceVersion=42.0.0
Detected Gradle version major=5 minor=6
Build property: publishToMaven=false
Build property: publishToNexus=false
Release Version: 0.15.0

> Configure project :gobblin-distribution
Using flavor:standard for project gobblin-distribution

FAILURE: Build Failed with an exception.

* Where:
Script 'D:\Gobblin\Apache_Gobblin_GitHub\incubator-gobblin\gobblin-restli\api.gradle' line: 31

* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'pegasus' not found.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:227)
        at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:74)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:232)

 at org.gradle.api.Script$apply$1.callCurrent(UnkNown Source)
        at build_6ww7rnuapw983hkfq0iq3sm5p.run(D:\Gobblin\Apache_Gobblin_GitHub\incubator-gobblin\gobblin-restli\gobblin-flow-config-service\gobblin-flow-config-service-api\build.gradle:1)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)

    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.plugins.UnkNownPluginException: Plugin with id 'pegasus' not found.
        at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:134)




* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build,making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD Failed in 17s

API.gradle 文件

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License,Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,software
 * distributed under the License 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.
 */

buildscript {

  apply from: "${rootProject.projectDir}/gradle/scripts/repositories.gradle",to: buildscript

  dependencies {
    classpath (group: 'com.linkedin.pegasus',name: 'gradle-plugins',version: rootProject.pegasusversion) {
      exclude group: 'org.apache.ant'
    }
  }

}

apply plugin: 'java'
apply plugin: 'pegasus'

if (file('exTradependencies.gradle').exists()) {
  apply from: 'exTradependencies.gradle'
}

dependencies {
  dataModel externalDependency.pegasus.restliCommon

  compile externalDependency.pegasus.data
  compile externalDependency.pegasus.restliClient
  compile externalDependency.pegasus.restliCommon
  compile externalDependency.pegasus.pegasusCommon
}

// Configure sources and javadoc jars for the data template library
def dataTemplateName = project.name + "-data-template"

task dataTemplateSourcesJar(type: Jar,dependsOn: classes) {
  from sourceSets.mainGeneratedDataTemplate.allSource
  classifier = 'sources'
  baseName = dataTemplateName
}

task dataTemplateJavadoc(type: Javadoc,dependsOn: classes) {
  source sourceSets.mainGeneratedDataTemplate.allSource
  classpath = files(sourceSets.mainGeneratedDataTemplate.compileClasspath)
  destinationDir file("${rootProject.buildDir}/${dataTemplateName}/docs/javadoc")
}

task dataTemplateJavadocJar(type: Jar,dependsOn: 'dataTemplateJavadoc') {
  from dataTemplateJavadoc
  baseName = dataTemplateName
  classifier = 'javadoc'
}

artifacts {
  archives mainDataTemplateJar,dataTemplateSourcesJar,dataTemplateJavadocJar
}

if (file("${project.projectDir}/src/main/idl").exists()) {

  // Configure sources and javadoc jars for the rest client  library
  def restClientName = project.name + "-rest-client"

  task restClientSourcesJar(type: Jar,dependsOn: classes) {
    from sourceSets.mainGeneratedRest.allSource
    classifier = 'sources'
    baseName = restClientName
  }

  task restClientJavadoc(type: Javadoc,dependsOn: classes) {
    source sourceSets.mainGeneratedRest.allSource
    classpath = files(sourceSets.mainGeneratedRest.compileClasspath)
    destinationDir file("${rootProject.buildDir}/${restClientName}/docs/javadoc")
  }

  task restClientJavadocJar(type: Jar,dependsOn: 'restClientJavadoc') {
    from restClientJavadoc
    baseName = restClientName
    classifier = 'javadoc'
  }

  artifacts {
    archives mainRestClientJar,restClientSourcesJar,restClientJavadocJar
  }

  publishing.publications {
      restClient(MavenPublication) {
        artifactId restClientName
        artifacts = [mainRestClientJar,restClientJavadocJar]
        pom pomAttributes
        pom.withXml addRuntimeDependenciesToPom
      }
  }
  addPublicationToBintray("restClient")
}

install {
  repositories {
    mavenInstaller {
      addFilter('data-template') { artifact,file -> artifact.name.contains("data-template")
      }
      addFilter('rest-client') { artifact,file -> artifact.name.contains("rest-client")
      }
      addFilter('') { artifact,file -> artifact.name == project.name
      }
    }
  }
}

if (rootProject.ext.publishToMaven || rootProject.ext.publishToNexus) {
  uploadArchives {
    repositories {
      mavendeployer {
        addFilter('data-template') { artifact,file -> artifact.name.contains("data-template")
        }.project(rootProject.pomAttributes)
        addFilter('rest-client') { artifact,file -> artifact.name.contains("rest-client")
        }.project(rootProject.pomAttributes)
        addFilter('') { artifact,file -> artifact.name == project.name
        }.project(rootProject.pomAttributes)
      }
    }
  }
}

publishing.publications {
    dataTemplate(MavenPublication) {
      artifactId dataTemplateName
      artifacts = [mainDataTemplateJar,dataTemplateJavadocJar]
      pom pomAttributes
      pom.withXml addRuntimeDependenciesToPom
    }
}
addPublicationToBintray("dataTemplate")

解决方法

maven server 有一些贬值,导致 pegasus lib 丢失,但在 master 上修复了。

最后加入 apache-gobblin.slack.com 的 slack 团队以获得更多关于 Gobblin 的帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?