我使用xjc到maven-jaxb2-plugin从几个xsd文件生成类。
我需要package-info.java文件(对于一个包)包含以下内容,以便为解组时生成的XML元素定义名称空间前缀。
@javax.xml.bind.annotation.XmlSchema(
namespace = "http://www.daisy.org/DRM/2005/BookAuthorization",
xmlns = {
@XmlNs(prefix = "", namespaceURI = "http://www.daisy.org/DRM/2005/BookAuthorization"),
@XmlNs(prefix = "odrld", namespaceURI = "http://odrl.net/1.1/ODRL-DD"),
@XmlNs(prefix = "odrlx", namespaceURI = "http://odrl.net/1.1/ODRL-EX"),
@XmlNs(prefix = "ds", namespaceURI = "http://www.w3.org/2000/09/xmldsig#"),
@XmlNs(prefix = "xe", namespaceURI = "http://www.w3.org/2001/04/xmlenc#"),
@XmlNs(prefix = "xsi", namespaceURI = "http://www.w3.org/2001/XMLSchema-instance")
},
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.daisy.drm._2005.bookauthorization;
import javax.xml.bind.annotation.XmlNs;
如何使用maven-jaxb2-plugin完成此操作?是否可以在jax-bindings.xjb中指定它?