Module types

A module type is used when you build, test or package a module. Depending on the type of the module, these commands will do different things and/or package the module differently.

Karma knows about six types of modules. Click on the module type's link to learn more about how the module is build, tested and packaged.

TypeIDDescription
Library moduleLIBRARY-MODULEA module of this type stores libraries (typically 3rd party libraries). These libraries are used as dependencies of a module.
Java source moduleJAVA-SOURCE-MODULEA module of this type stores Java source code, the corresponding unit tests and configuration data. The result of packaging a module of this type is a .jar file.
Java application moduleN/AThis module type is not implemented yet (but is intended to in version 1.0 of Karma).
Java web application moduleJAVA-WEB-APPLICATIONA module of this type stores all information that is needed to create one Java web application. The result of packaging a module of this type is a .war file.
Java enterprise application moduleJAVA-ENTERPRISE-APPLICATIONA module of this type stores all information that is needed to create one Java enterprise application. The result of packaging a module of this type is a .ear file.
Other moduleOTHER-MODULEThis type of module was introduced for storing files that do not belong in a module of one of the above types. The result of packaging a module of this type is a .zip file containing a 1-to-1 copy of all files in the module, except the Karma system files.

The type of a module is stored in the module's module-descriptor.xml. The following descriptor is generated as a result of a create-module command the specified JAVA-SOURCE-MODULE as the module type:


<?xml version="1.0"?>
<module-descriptor version="1-0">
  <type>JAVA-SOURCE-MODULE</type>
  <layout-specification/> <!-- for future usage -->
</module-descriptor>

Depending on the module type a different module template is used. This template describes the directory structure and optionally the default files of a module. See the description of the module types for their directory structures.