How do I create a JAXB project in IntelliJ IDEA 13?
You don't need to do anything when you build your project. Only a simple java project will do.
However, there are some tricks that can help you. There are two built-in live templates for jaxb :
- type
mjo
+ hit tab-key: will generate code for the marshaler. - typing
ujo
+ hit tab-key: will generate code for unmarshaller.
Intellij has built-in functions to generate a filexsd
for any file xml
. Just right click on any file xsd
and you will see the button "Generate xsd schema from xml file".
JAXB also offers a tool ( xjc.exe
) for generating JAXB code snippets. There is an easy way to add this functionality to IntelliJ. I prefer to add a button for xsd
in the Java source conversion using the configuration in the External Tools menu.
After this configuration, you can right click on the xsd file and the "JAXB (XSD-> JAVA)" button will appear.
Note. According to some websites there is also a dialog / wizard for creating jaxb chunks. However, I haven't found this master yet. It may only be available in later versions of IntelliJ (14+), perhaps only in a commercial release, or some plugins may be required. My solution works great in IntelliJ 13.0.3 - Community Edition.
source to share