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.
Asked
Active
Viewed 1,109 times
2 Answers
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
-
I am using IntelliJ IDEA, so this option worked for me. Thanks. – Alfredo A. Oct 08 '15 at 19:27
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

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