在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):boothen/gradle-wsimport开源软件地址(OpenSource Url):https://github.com/boothen/gradle-wsimport开源编程语言(OpenSource Language):Java 97.3%开源软件介绍(OpenSource Introduction):Gradle WSImport PluginGradle plugin that wraps the Ant wsimport task providing a simple and clean DSL to generate source and class files from a WSDL. Using the pluginThe plugin is registered with Gradle Plugins. The simplest way to define and use the plugin in your Gradle build file is plugins {
id "uk.co.boothen.gradle.wsimport" version "0.18"
} Simple configurationThe plugin is intend to be as configuration light as possible. Using default values for most configuration properties. Therefore, it should be possible to generate and compile Java source classes from a WSDL file with just the following configuration. wsimport {
wsdl = "create/Create.wsdl"
} WSDL PropertyThe WSDL property is the only property required to be set. Multiple WSDL properties can be defined.
Multiple WSDL files can be configured as follows wsimport {
wsdl = "create/Create.wsdl"
wsdl = "find/Find.wsdl"
wsdl = "update/Update.wsdl"
} Detailed configurationHowever, more complex configuration can be specified if required. The example below highlights how to specify those properties. wsimport {
wsdlSourceRoot = "/src/main/resources/wsdl"
generatedSourceRoot = "/generated/src/wsdl/main"
generatedClassesRoot = "/classes/main"
includeDependencies = true
target = "3.0"
keep = true
extension = true
verbose = false
quiet = true
debug = false
xnocompile = true
xadditionalHeaders = false
xNoAddressingDatabinding = false
wsdl ("create/Create.wsdl") {
bindingFile("create/bindings-create.xml")
xjcarg("-XautoNameResolution")
extraArg("-J-Djavax.xml.accessExternalDTD=all")
packageName("com.different.package.name")
wsdlLocation("schema/schema.wsdl")
catalog("catalog/jax-ws-catalog.xml")
}
wsdl ("find/Find.wsdl") {
bindingFile ("find/bindings-find.xml")
xjcarg ("-XautoNameResolution")
}
wsdl ("update/Update.wsdl") {
bindingFile ("update/bindings-update.xml")
xjcarg ("-XautoNameResolution")
}
} Configuration propertiesJava Source and Compilation properties
WSDL file additional configuration properties
Jakarta packages vs Javax packagesFrom version 0.18 the plugin is defaulted to use JAXWS 3.0 specification version. This generates classes with the jakarta.* packages instead of the javax.* packages. To revert back to using javax packages the following configuration can be specified. dependencies {
// Specify previous version of JAXWS tools to use
jaxWsTools "com.sun.xml.ws:jaxws-tools:2.3.2"
// Specify previous version of WS/XML/JWS classes
implementation"javax.xml.bind:jaxb-api:2.3.1"
implementation "javax.xml.ws:jaxws-api:2.3.1"
implementation "javax.jws:javax.jws-api:1.1"
}
wsimport {
// Exclude Jakarta WS/XML/JWS classes implementation dependencies
includeDependencies = false
// Set JAXWS specification to 2.2
target = "2.2"
wsdl = "create/Create.wsdl"
...
} To DoThe following properties have not been exposed from the Ant task to the plugin. If you need any of them in your configuration submit a PR or an Issue and we'll add it in.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论