无法应用插件[id'org.openapi.generator']

时间:2018-10-11 17:29:59

标签: gradle swagger-2.0 openapi-generator

build.gradle

buildscript {
    repositories {
        mavenLocal()
        maven { url "https://artifactory.company.net:443/artifactory/libs-snapshot" }
        maven { url "https://artifactory.company.net/artifactory/libs-release" }
        jcenter()
        maven { url "http://repo.spring.io/plugins-release" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.RELEASE")
        classpath "io.spring.gradle:propdeps-plugin:0.0.10.RELEASE"
        classpath "org.openapitools:openapi-generator-gradle-plugin:3.2.0"
        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.5.2"
    }
}

当我尝试应用此插件时出现异常。我尝试使用最新的Gradle 4.10.2 和旧版本 4.2.1 ,并使用了该插件的多个版本。

apply plugin: 'org.openapi.generator'

例外

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'org.openapi.generator']
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:150)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:125)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:120)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:38)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:86)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:143)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
    at build_cf4aqu9jl2xl73vdxs56nz55v.run(/Users/trpge09/Develop/jHipster/makara-microservice-template/build.gradle:115)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
    ... 97 more
Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorMetaExtension.
    at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:223)
    at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:79)
    at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
    at org.gradle.api.internal.plugins.DefaultConvention.instantiate(DefaultConvention.java:236)
    at org.gradle.api.internal.plugins.DefaultConvention.create(DefaultConvention.java:138)
    at org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin.apply(OpenApiGeneratorPlugin.kt:39)
    at org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin.apply(OpenApiGeneratorPlugin.kt:36)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42)
    at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:50)
    at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:165)
    at org.gradle.api.internal.plugins.DefaultPluginManager.access$200(DefaultPluginManager.java:47)
    at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:252)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
    ... 110 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/provider/Property
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.gradle.internal.reflect.ClassInspector.inspectClass(ClassInspector.java:72)
    at org.gradle.internal.reflect.ClassInspector.visitGraph(ClassInspector.java:56)
    at org.gradle.internal.reflect.ClassInspector.inspect(ClassInspector.java:36)
    at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:283)
    at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:238)
    at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:110)
    ... 126 more
Caused by: java.lang.ClassNotFoundException: org.gradle.api.provider.Property
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 135 more

0 个答案:

没有答案