在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):nilsmagnus/wsdl2java开源软件地址(OpenSource Url):https://github.com/nilsmagnus/wsdl2java开源编程语言(OpenSource Language):Java 78.9%开源软件介绍(OpenSource Introduction):Deprecation noticeThis plugin is no longer maintained by its creator since I dont have any interest in using this plugin anymore and find no pleasure in maintaining it for free/fun. Please fork it and use it as you like. The plugin is not published to any relevant plugin-portals. wsdl2java gradle pluginGradle plugin for generating java from wsdl, using cxf under the hood and the same options as the maven wsdl-2-java plugin from apache-cxf. The plugin binaries are downloadable from bintray: https://bintray.com/nilsmagnus/maven/wsdl2java/ IssuesIf you have any issues with the plugin, please file an issue at github, https://github.com/nilsmagnus/wsdl2java/issues ContributionContributions are welcome as long as they are sane. Contributors
CXFThis plugin uses the apache-cxf tools to do the actual work. Tasks
UsageTo use this plugin, you must
Applying the pluginGroovy: buildscript{
repositories{
jcenter()
mavenCentral()
}
dependencies {
classpath 'no.nils:wsdl2java:0.12'
}
}
apply plugin: 'no.nils.wsdl2java' Kotlin: plugins {
id("java")
id("no.nils.wsdl2java") version "0.12"
} Plugin options
Example setting of options: Groovy: wsdl2java {
wsdlDir = file("src/main/resources/myWsdlFiles") // define to support incremental build
wsdlsToGenerate = [ // 2d-array of wsdls and cxf-parameters
['src/main/resources/wsdl/firstwsdl.wsdl'],
['-xjc','-b','bindingfile.xml','src/main/resources/wsdl/secondwsdl.wsdl']
]
locale = Locale.GERMANY
cxfVersion = "2.5.1"
cxfPluginVersion = "2.4.0"
} Kotlin: extra["cxfVersion"] = "3.3.2"
extra["cxfPluginVersion"] = "3.2.2"
wsdl2java {
wsdlDir = file("$projectDir/src/main/wsdl")
wsdlsToGenerate = listOf(
listOf("$wsdlDir/firstwsdl.wsdl"),
listOf("-xjc", "-b", "bindingfile.xml", "$wsdlDir/secondwsdl.wsdl")
)
} Options for xsd2java (deprecated, separate plugin coming soon)This will not work for version 0.8+!
Example setting of options: xsd2java {
encoding = 'utf-8'
xsdsToGenerate = [
["src/main/resources/xsd/CustomersAndOrders.xsd", 'no.nils.xsd2java.sample', [header: false] /* optional map */]
]
generatedXsdDir = file("generatedsources/xsd2java")
} Complete example usageThis is a an example of a working build.gradle for a java project. You can also take a look at the test resources, which contain two working projects. buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'no.nils:wsdl2java:0.12'
}
}
apply plugin: 'java'
apply plugin: 'no.nils.wsdl2java'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:+'
}
wsdl2java {
wsdlsToGenerate = [
['-p', 'com.acme.mypackage', '-autoNameResolution', "$projectDir/src/main/resources/wsdl/stockqoute.wsdl"]
]
wsdlDir = file("$projectDir/src/main/resources/wsdl")
locale = Locale.FRANCE
cxfVersion = "2.5.1"
cxfPluginVersion = "2.4.0"
} Java 9+ supportThis plugin automatically adds the necessary dependencies to work on Java 9+ when detected. As of now, these dependencies are added: implementation "javax.xml.bind:jaxb-api:2.3.1",
implementation "javax.xml.ws:jaxws-api:2.3.1",
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2",
implementation "org.glassfish.main.javaee-api:javax.jws:3.1.2.2",
implementation "com.sun.xml.messaging.saaj:saaj-impl:1.5.1" Enable basic extension support for xjcApache CXF supports extension for xjc, e.g. for creating a hashCode, equals and toString method in the classes generated by xjc. dependencies() {
compile 'org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.11.0'
// enable extension support for wsdl2java
wsdl2java 'org.jvnet.jaxb2_commons:jaxb2-basics-runtime:0.11.0'
wsdl2java 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0'
}
wsdl2java{
wsdlsToGenerate = [
['-xjc-Xequals', '-xjc-XhashCode', 'src/main/resources/com/example/api/interface.wsdl']
]
} This example creates the hashCode and the equals method. A notice on multi-module projectsInstead of referring to absolute paths in your build-file, try using $projectDir as a prefix to your files and directories. As shown in the "Complete example usage". Releasing
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论