1

在构建 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, restClientSourcesJar, 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, dataTemplateSourcesJar, dataTemplateJavadocJar]
      pom pomAttributes
      pom.withXml addRuntimeDependenciesToPom
    }
}
addPublicationToBintray("dataTemplate")
4

1 回答 1

0

maven 服务器的一些折旧导致 pegasus lib 丢失但它固定在 master 上。

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

于 2021-06-22T04:43:27.507 回答