How to use the Maven 2 archetypes for Castor
Documentation Author(s): Werner Guttmann
Introduction Template for XML code generator test case Template for JDO test case Snapshot releases of archetypes
Introduction
Maven 2 has a very sophisticated feature named 'archetype' for bootstrapping development
with e.g. frameworks such as Castor is. As we do have a very high appreciation
for the benefits of this feature, we provide a selection of Maven 2 archetypes
for Castor.
codegen-testcase |
A template for a XML code generator test case, incl. JUnit test case,
sample XML schema, builder properties and binding file. |
cpa-testcase |
A template for a JDO test case, incl. JUnit test case,
JDO configuration file, JDO mapping file and test entity. |
|
Template for XML code generator test case
This archetype creates a standard Maven project with a preconfigured
project structure that includes the following artefacts:
|
- | JUnit test case |
- | Sample XML schema |
- | (Empty) builder properties file |
- | (Empty) XML code generator binding file |
- | A Maven 2 POM with all the required dependencies (Castor XML, etc.). |
In order to e.g. create a project based upon the codegen-testcase archetypes
shown above, please issue the following Maven goal on your command line (of choice):
> mvn archetype:create -DarchetypeGroupId=org.codehaus.castor \
-DarchetypeArtifactId=codegen-testcase \
-DarchetypeVersion=1.3.1 \
-DgroupId=<your.group.id> \
-DartifactId=<your.artitact.id> \
-DpackageName=
|
|
Template for JDO test case
This archetype creates a standard Maven project with a preconfigured
project structure that includes the following artefacts:
|
- | JUnit test case |
- | JDO configuration file |
- | JDO mapping file |
- | DDL statements |
- | A Maven 2 POM with all the required dependencies (Castor JDO, etc.). |
In order to e.g. create a project based upon the cpa-testcase archetypes
shown above, please issue the following Maven goal on your command line (of choice):
> mvn archetype:create -DarchetypeGroupId=org.codehaus.castor \
-DarchetypeArtifactId=cpa-testcase \
-DarchetypeVersion=1.3.1 \
-DgroupId=<your.group.id> \
-DartifactId=<your.artitact.id> \
-DpackageName=
|
|
Snapshot releases of archetypes
In case you are trying to use an archetype that has been made available as a snapshot
release only, please makse sure you include the Codehaus Maven 2 repository in the
command as shown above similar to ...
> mvn archetype:create -DarchetypeGroupId=org.codehaus.castor \
-DarchetypeArtifactId=codegen-testcase \
-DarchetypeVersion=1.3-SNAPSHOT \
-DgroupId=<your.group.id> \
-DartifactId=<your.artitact.id> \
-DpackageName=
-DremoteRepositories=http://maven.codehaus.org/maven2/
|
|
Once a specific Castor release has been propagated to the main Maven 2 repository at
ibiblio
(usually within 48 hours), adding just the dependency will be sufficient.
|