|  |  |  | License Codehaus OpenEJB OpenJMS OpenORB Tyrex

Old releases
General
Release 1.3
Release 1.3rc1
Release 1.2

Main
Home
About
Features
Download
Dependencies
Reference guide
Publications
JavaDoc
Maven 2 support
Maven 2 archetypes
DTD & Schemas
Recent HTML changes
News Archive
RSS news feed
Project Wiki

Development/Support
Mailing Lists
SVN/JIRA
Contributing
Support
Continuous builds
Prof. services

Related projects
Spring ORM support
Spring XML factories
WS frameworks

XML
XML

XML Code Generator
XML Code Generator

JDO
Introduction
First steps
Using JDO
JDO Config
Types
JDO Mapping
JDO FAQ
JDO Examples
JDO HOW-TOs
Tips & Tricks
Other Features
JDO sample JAR

Tools
Schema generator

Advanced JDO
Caching
OQL
Trans. & Locks
Design
KeyGen
Long Trans.
Nested Attrs.
Pooling Examples
LOBs
Best practice

DDL Generator
Using DDL Generator
Properties
Ant task
Type Mapping

More
The Examples
3rd Party Tools
JDO Tests
XML Tests
Configuration

About
License
User stories
Contributors
Marketplace
Status, Todo
Changelog
Library
Contact
Project Name

## 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.

Name | Description
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.

<notice> Copyright © 1999-2005 ExoLab Group, Intalio Inc., and Contributors. All rights reserved. </notice>
<notice> Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners. </notice>