JiBX: Building

# JiBX: Building |

JiBX Basics Overview Flexibility Performance Clean code News and Status User Comments Sponsors Support and Training Bugs Getting Started Binding Tutorial A basic binding Binding extras Structure mapping Collections and arrays Using mappings Advanced binding Method hooks Custom code Binding Compiler Binding on Load Runtime JiBX Extras Building JiBX Schema Compatibility Mailing Lists FAQ Contributing License Binding Definition Definition details Definition contexts Conversions XML summary <binding> element <include> element <format> element <namespace> element <mapping> element <value> element <structure> element <collection> element Attribute groups Usage API Runtime JavaDocs Subprojects Eclipse Plug-in Introduction Install Usage Generator Tools Axis2 Usage JibxSoap Xsd2Jibx | ### Building JiBX To build JiBX, either from the distribution or from a CVS image, use the Ant build.xml file in the /build directory. The default Ant target compiles the full JiBX code with debug information enabled, runs the full set of tests, and creates the actual distribution zip file. The "testing" target just rebuilds the jars (in the /lib directory) and runs the tests. The "small-jars" target builds the jars with debug information turned off (useful if the jar sizes are a concern for your project). As of the 1.1 release, the Ant build also supports a "j2me" target. This uses the JEnable tool to selectively disable portions of the JiBX source code in order to build a distribution that's compatible with J2ME environments. The jar files generated by this target (which go in the /lib directory of the JiBX distribution, just like the standard jars) all include "-j2me-" in their names in order to distinguish them from the standard JiBX jars. The "j2me" target compiles with debug information enabled in order to keep jar sizes to a minimum. Note that the JiBX source code repository contains classes which are not actually used in the current JiBX distribution, and these classes may not even compile properly. The Ant build specifies which classes to include and exclude when compiling the project. If you use an IDE or other tool to build JiBX, you will need to exclude the unused source files from your project. Most modern IDEs will allow you to create a project based on an Ant build, and this is generally the best way to start out. The Ant build looks for dom4j.jar and jdom.jar files in the /lib directory. If these jar file are present the build will include the classes in the jibx-extras.jar that support working with these document models. If the jars are not found these classes will be missing from the generated jibx-extras.jar. Additionally, building the JavaDocs without these jars will result in some error messages. These error messages can be ignored. The build has been tested on JDK versions 1.3, 1.4, and 1.5. JDK 1.3 does not include the JAXP library (used by the JiBX extras code for DOM document model support) in the distribution, so to build with JDK 1.3 you need a JAXP implementation. As a convenience, the supplied build file will look for Xerces jar files in the /lib directory and include these in the classpath if the jars are present. The jar files needed for this purpose are xercesImpl.jar and xml-apis.jar. To build the internal JavaDocs, use the Ant "devdoc" target. This will generate the full JavaDocs for all JiBX code (rather than just the user-visible classes included in the normal JavaDocs) to the /build/docs/dev directory. If you're building JiBX within an IDE environment, you can use the Ant build-binding.xml file in the /build directory to compile the JiBX bindings used by the binding compiler itself. You'll need to recompile these bindings any time classes in the `org.jibx.compiler.model` package are recompiled by the IDE.