How to generate Java from an XSD using MOXy under Maven-3?

早过忘川 提交于 2019-12-10 15:49:06

问题


What's the easiest/best way to generate Java from an XSD using MOXy under Maven-3? The reference JAXB interface has a nice Maven plugin, but it doesn't appear to support MOXy.

Does anyone have anything concrete to offer? (I know I can write ant-script, or a plugin, or ...)


回答1:


EclipseLink MOXy, does not yet offer a Maven plugin to run the XML schema to Java compiler. I have entered the following enhancement request to track this functionality:

  • https://bugs.eclipse.org/346486

MOXy leverages the XJC component from the reference implementation, so you could access that Maven plug-in and add then add the jaxb.properties file specifying MOXy as the JAXB provider:

  • http://jaxb.java.net/jaxb-maven2-plugin/
  • http://bdoughan.blogspot.com/2011/05/specifying-eclipselink-moxy-as-your.html


来源:https://stackoverflow.com/questions/6060873/how-to-generate-java-from-an-xsd-using-moxy-under-maven-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!