0

I have been using hyperjaxb tool to generate JPA entities and database scripts from XSD schemas. Now I want basically the inverse operation. How can I generate XSD schemas based on JPA anotated entities or database? I am using Maven, so any maven solution would be preferable.

Alfredo A.
  • 1,697
  • 3
  • 30
  • 43

2 Answers2

1

If you're using IntelliJ IDEA, see the following link:

https://www.jetbrains.com/idea/help/generate-xml-schema-from-java-using-jaxb-dialog.html

hermitmaster
  • 155
  • 1
  • 10
0

This maven plugin ( jaxb2-maven-plugin ) might be useful for you. This post has more information about its usage and the given example uses POJO's to do the transformation

Generate XSD from Java class

ajup
  • 330
  • 2
  • 12
  • According to that, I have to annotate my Java classes with JAXB annotations. Is there a way to not to be forced to do that? – Alfredo A. Oct 08 '15 at 15:51
  • I believe that you need the JAXB annotations. Another option is to use schemagen.exe on the command line ( found within the Java JDK\bin directory) to create the XSD files – ajup Oct 08 '15 at 18:15
  • 1
    [Link to the Oracle document ] https://docs.oracle.com/javase/8/docs/technotes/tools/unix/schemagen.html – ajup Oct 08 '15 at 18:17