Skip to content
forked from sbt/sbt-xjc

SBT 0.10 plugin to compile XML Schema with XJC.

License

Notifications You must be signed in to change notification settings

theBlackDragon/sbt-xjc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-xjc An SBT Plugin to compile XML Schemata to JAXB Java sources with XJC

Usage

Depend on the plugin: ./project/plugins.sbt. Requires SBT 0.12.x or 0.13.x

addSbtPlugin("org.scala-sbt.plugins" % "sbt-xjc" % "0.8")

Configure

By default, all XSDs found under unmanagedResourceDirectories will be compiled. This is repeated in the Compile and Test scopes. The table below show the configuration for the Compile scope; replace with Test to configure that scope.

KeyTypeDefaultDescriptionExample
xjcLibsSeq[ModuleId]jaxb-api 2.1, jaxb-impl and jaxb-xjc 2.1.9 The artifacts to download to run XJC
xjcPluginsSeq[ModuleId]The artifacts to download containing XJC plugins
xjcBindingsSeq[String]Files used to customize JAXB bindings
xjcCommandLineSeq[String]Additional command line, e.g. -verbose -Xfluent-api
xjcJvmOptsSeq[String]Additional JVM command line, e.g. -Djavax.xml.accessExternalSchema=file to allow compilation of schemas consisting of multiple files
sources in (Compile, xjc)Seq[File]${unmanagedResourceDirectories} ** "*.xsd"Input XSD Files sources in (Compile, xjc) <<= sourceDirectory map (_ / "main" / "schema" ** "*.xsd" get)
sourceManaged in (Compile, xjc)File${sourceManaged}/compile/xjc Target for generated files. Should not be shared with other generated files

See the Tests for example builds.

As a convenience, the fluent API settings are provided in SbtXjcPlugin.fluentApiSettings

Use

The timestamps of the source XSD files is compared with the generated files, and if newer these are compiled. This occurs automatically before compilation.

Problems

You can troubleshoot problems by inspecting debug logs with > last xjc.

Please use the Issue Tracker here if you find a bug. Do not raise bugs for problems with your schema or with usage of XJC itself.

About

SBT 0.10 plugin to compile XML Schema with XJC.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%