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.

Build Module with module.properties

In the module source code, 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 into module.template.xml via string substitution. 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
BuildNumberThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The build number.
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' in the root of your enlistment, or add the following to the 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; teamcity-agent for pre-built artifacts.
DescriptionMulti-line description of module.
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.
LabelOne line description of module's purpose (display capitalized and without a period at the end).
LicenseLicense name: e.g. "Apache 2.0", "LabKey Software License", etc.
LicenseURLLicense URL: e.g. "http://www.apache.org/licenses/LICENSE-2.0"
MaintainerComma separated list of names and, optionally, email addresses: e.g. "Adam Smith <adams@someemail.com>, Kevin Kroy"
ModuleClassMain class for the module. For modules without Java code, use org.labkey.api.module.SimpleModule
NameThe display name for the module.
OrganizationThe organization responsible for the module.
OrganizationURLThe organization's URL/homepage.
RequiredServerVersionoooThe minimum required version for LabKey Server.
ResourcePathThis value is set internally by the build, and does not need to be provided by the developer in module.properties.
SchemaVersionCurrent version number of the module's schemas. Controls the running of SQL schema upgrade scripts.
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.
SupportedDatabasesAdd this property to indicate that your module runs only on a particular database. Possible values: "pgsql" or "mssql".
URLThe homepage URL for additional information on the module.
VcsRevisionThis value is set internally by the build, and does not need to be provided by the developer in module.properties. The 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 server that manages the source code for this module. This will be displayed next to the module in the site admin console.
AuthorComma separated list of names and, optionally, email addresses: e.g. "Adam Smith <adams@someemail.com>, Kevin Kroy"

Properties Surfaced in the Admin Console

Module properties are visible to administrators via (Admin) > Site > Admin Console > 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.

Properties for File Based Modules

File based modules do not go through the same build process, and will show only a minimal set of module properties in the Admin Console. Seeing many blank lines is expected.

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all