Archetypes are essentially project templates that can be used as a starting point for a new project.
Using a archetype is quite simple. Change to, or create, an empty directory for the new project. Then type:
$ quokka archetype
This will list all the currently available archetypes compatible with your quokka installation.
Available Archetypes
====================
quokka.archetype.depset: 0.2*
Archetype for a project that creates a dependency set
quokka.archetype.jar: 0.3*
Archetype for a Java project that creates a single .jar file
quokka.archetype.multiproject: 0.2*
Archetype for a Java project consisting of multiple modules (or sub-projects)
quokka.archetype.war: 0.1*
Archetype for building a Web Application (.war) fileIf you're happy with the default selected version (marked with a star), you can then pick your desired archetype and execute it as follows:
$ quokka archetype -Darchetype=<archetypeId>
where:
- archetypeId
Is the id of the artifact in the format <group>:[name][:version].
- property, value
Are any properties that the particular archetype understands. Consult the archetype documentation for a list of available properties.
- repositoryId
Optional. The id of the repository to retrieve the archetype from
- repository
Optional. The url of the repository to retrieve the archetype from
For example, to create a new project that build a .jar file you can use:
$ quokka archetype -Darchetype=quokka.archetype.jar
This will create a project skeleton for you in the current directory that you can use as a starting point for your project.
It is also possible to create your own archetypes if you create multiple projects with a similar structure. However, you should use a dependency set instead if possible, as changes to a dependency set are automatically available to all projects that use it. Reserve archetypes for templates that have additional files or directory structures.
See the source code of the
quokka.archetype.jar module for an example of how
to build an archetype. It is really just a template directory with
tokens defined for substitution when the archetype is
extracted.