无法应用插件 'no.nils.wsdl2java'。未找到名称为 'compile' 的配置

Failed to apply plugin 'no.nils.wsdl2java'. Configuration with name 'compile' not found

迁移到 gradle 时 7.x 低于错误


* What went wrong:
An exception occurred applying plugin request [id: 'no.nils.wsdl2java', version: '0.12']
> Failed to apply plugin 'no.nils.wsdl2java'.
   > Configuration with name 'compile' not found.

下面是build.gradle

中添加的wsdl2java

plugins {
    id("no.nils.wsdl2java") version "0.12"
    `java-library`
}

buildscript {
    dependencies {
        classpath("no.nils:wsdl2java:0.12")
    }
}

如何解决这个问题?

no.nils.wsdl2java 与 Gradle 7 不兼容,不再维护。请参阅项目中的 READMEcompile 配置早已被弃用,最终在 Gradle 7.

中被删除

您可以使用 io.mateo.cxf-codegen 代替 no.nils.wsdl2java。它是 Maven CXF 代码生成插件的 Gradle 端口。

plugins {
    id "io.mateo.cxf-codegen" version "1.0.1"
}

https://github.com/ciscoo/cxf-codegen-gradle

https://ciscoo.github.io/cxf-codegen-gradle/docs/current/user-guide/


注意,我是插件的作者。