Developers specify various properties of a module via a module.properties file, a file of fixed property/value strings. These properties affect the behavior of the module and are shown in the Admin Console. In source, this file is located in the module root at MODULE_ROOT/module.properties.

helloWorldModule
│ module.properties
└───resources
├───...
├───...
└───...

When you run the standard targets to build LabKey Server, the property/value pairs in module.properties are extracted and used to populate a config/module.xml file (via string substitution into module.template.xml). The resulting config/module.xml file is copied to the module's config subdirectory (MODULE_NAME/config/module.xml) and finally packaged into the built .module file. At deployment time, the server loads properties from config/module.xml, not module.properties (which the server ignores). Note that modules that contain Java code must be built using the standard build targets in the open source project. (This generated module.xml file is not be be confused with the module.xml file described here.)

module.properties Examples

The following module.properties file is for a simple file-based module which contains no Java classes to compile:

Name: HelloWorld
ModuleClass: org.labkey.api.module.SimpleModule

Modules that contain Java classes should reference their main Java class. For example, the Core module references the main controller class org.labkey.core.CoreModule:

Name: Core
ModuleClass: org.labkey.core.CoreModule
SchemaVersion: 20.001
Label: Administration and Essential Services
Description: The Core module provides central services such as login, security, administration, folder management, user management, module upgrade, file attachments, analytics, and portal page management.
Organization: LabKey
OrganizationURL: https://www.labkey.com/
License: Apache 2.0
LicenseURL: http://www.apache.org/licenses/LICENSE-2.0

module.properties Reference

Available properties for module.properties.

Property NameDescription
ModuleClassMain class for the module. For modules without Java code, use org.labkey.api.module.SimpleModule
NameThe display name for the module.
SchemaVersionCurrent version number of the module's schemas. Controls the running of SQL schema upgrade scripts.
RequiredServerVersionoooThe minimum required version for LabKey Server.
SupportedDatabasesAdd this property to indicate that your module runs only on a particular database. Possible values: "pgsql" or "mssql".
LabelOne line description of module's purpose (display capitalized and without a period at the end).
DescriptionMulti-line description of module.
URLThe homepage URL for additional information on the module.
AuthorComma separated list of names and, optionally, email addresses: e.g. "Adam Smith <adams@someemail.com>, Kevin Kroy"
MaintainerComma separated list of names and, optionally, email addresses: e.g. "Adam Smith <adams@someemail.com>, Kevin Kroy"
OrganizationThe organization responsible for the module.
OrganizationURLThe organization's URL/homepage.
LicenseLicense name: e.g. "Apache 2.0", "GPL-2.0", "MIT"
LicenseURLLicense URL: e.g. "http://www.apache.org/licenses/LICENSE-2.0"
VcsRevisionThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The SVN revision number of the module. This will be displayed next to the module in the site admin console.
VcsURLThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The URL to the SVN server that manages the source code for this module. This will be displayed next to the module in the site admin console.
BuildOSThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The operating system upon which the module was built. This will be displayed next to the module in the site admin console.
BuildPathThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The file path in which the module was built. This will be displayed next to the module in the site admin console.
BuildTimeThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The date and time the module was built. This will be displayed next to the module in the site admin console.
BuildTypePossible values are "Development" or "Production". "Development" modules will not deploy on a production machine. To build modules destined for a production server, run 'gradlew deployApp -PdeployMode=prod', or add the following to your module.properties file: 'BuildType=Production'.
BuildUserThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The name of the user that built the module. This will be displayed next to the module in the site admin console.
SourcePathThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The location of the module source code.
ResourcePathThis value is set internally by the build, and does not need to be provided by the developer in module.properties.
BuildNumberThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The build number.
EnlistmentIdThis value is set internally by the build, and does not need to be provided by the developer in module.properties. Used to determine whether the module was built on the current server.

Properties Surfaced in the Admin Console

Module properties are visible to administrators via (Admin) > Site > Admin Console, under the heading Module Information. Click an individual module name to see its properties. If you having problems loading/reloading a module, check the properties Enlistment ID and Source Path. When the server is running in devMode, these properties are displayed in green if the values in (the generated) module.xml match the values found on the server; they are displayed in red if there is a mismatch.

The properties for deployed modules are available in the table core.Modules, where they can be accessed by the standard query API.

Related Topics

Discussion

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand all collapse all