-
Notifications
You must be signed in to change notification settings - Fork 29
Basic_Project_Template
Basic project template is intended to help users starting Hyperjaxb3 projects. This is a simple project templates which contains the prepared directory structure, build scripts (for Ant or Maven) and libraries (in case of Ant).
You can download the basic project template here
- Unpack.
- Put your schema (
*.xsd) and binding files (*.xjb) intosrc/main/resources. - Put your XML samples (
*.xml) intosrc/test/samples. - Run
mvn clean installfor Maven orant clean installfor Ant. - Check
targetdirectory for results.
Below is the directory structure of the basic project template.
-
src- source folder;-
main- main source folder;-
java- main Java sources folder; -
resources- main resources folder;
-
-
test- test source folder folder;-
java- test Java sources folder; -
resources- test resources folder;-
log4j.properties- Log4J properties used during the test; -
persistence.properties- persistence properties used during the test;
-
-
samples- test samples folder;
-
-
-
lib(Ant only) - library folder;-
*.jar(Ant only) - libraries;
-
-
pom.xml(Maven only) - Maven build file; -
build.xml(Ant only) - Ant build file.
As noted above, the src/main/resources folder is used to store schema and binding files; src/test/samples is used for XML samples used during the roundtrip test.
Both Maven and Ant builds execute the following build phases:
This phase clean the project, removes the target directory.
During this phase JAXB schema compiler (XJC) together with Hyperjaxb3 XJC plugin generate source code in target/generated-sources/xjc.
This phase compiles the main Java code in src/main/java and generated Java code target/generated-sources/xjc. Compiled code will be placed under target/classes.
This phase compiles the test Java code in src/test/java. Compiled code will be placed under target/test-classes.
Executes unit tests from src/test/java and target/generated-sources/xjc. Basic project template instructs Hyperjaxb3 to generate XML-database rountrip test (unmarshall-save-load-marshall-compare) which is used to test if generated ORM annotations or mappings are functional.
Roundtrip test executed during this phase uses persistence properties from src/test/persistence.properties to configure the persistence provider. XML samples used for roundtripping are taken from the src/test/samples folder.
Packs the compiled code from target/classes and place the generated jar in the target directory.