SBT plugin for generating CXF Java classes from WSDLs using wsdl2java.
Add the plugin to your project/plugins.sbt
addSbtPlugin("io.dapas" % "sbt-cxf" % "0.2.0")
The plugin is an auto-plugin and is automatically added to all projects and registers itself as a source generator in the Compile
stage.
Any WSDLs added to the cxfWsdls
setting are automatically picked up. For example:
.settings(
cxfWsdls in Compile := Seq(
Wsdl(
id = "mywsdl",
wsdlFile = (resourceDirectory in Compile).value / "wsdl" / "my-wsdl.wsdl",
implementations = Seq(CxfImplementationType.Impl, CxfImplementationType.Client),
pkg = Some("com.acme.generated.jaxws.my"),
bindFile = Some((resourceDirectory in Compile).value / "wsdl" / "my-wsdl-bindings.xjb")
),
Wsdl(
id = "otherwsdl",
wsdlFile = (resourceDirectory in Compile).value / "wsdl" / "other.wsdl",
implementations = Seq(CxfImplementationType.Impl, CxfImplementationType.Client),
pkg = Some("com.acme.generated.jaxws.other")
)
)
)
You can configure the CXF version to use (default: 2.1.2) through the cxfVersion := "<version>"
setting
The plugin auto loads and when any WSDLs are defined under cxfWsdls
the Java classes are generated during a compile, prior to compiling the rest of the souces.
cxfVersion := "2.1.2"
- The CXF version to usecxfFlags := Seq("-validate", "-verbose", "-xjc -Xequals -XhashCode -XtoString")
- The CXF flags that are applied for all WSDLs in the projectcxfTarget := sourceManaged / "cxf"
- The directories to place the generated sources; using SBT defaults this would betarget/scala-2.xx/src_managed/cxf/<id>/
cxfWsdls := Seq.empty[Wsdl]
- The WSDLs to generate the classes for, defaults to empty which skips generationcxfLogLevel := "info"
- Log level of the wsdl2java binary, one of: ('trace', 'debug', 'info', 'warn', 'error' or 'off'). If not specified, defaults to 'info'
- 0.1.0 - First (rough) implementation
About everything, but also including
- Refactor output location and managedSource management
- Move logic out of the task definition to a separate object
- Add unit tests for the object
- Add more sbt scripted tests
- Add easier and more extensive configuration
This plugin is based on/drew inspiration from
- sbt-cxf-wsdl2java
Published source code and binary files have the following copyright:
Copyright Dapas Software B.V.
Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.html