Gld Extension Development: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 35: Line 35:
=Extension Version=
=Extension Version=


The extension version is part of the service class state, as the static member VERSION. In order to correctly report their version, the Service implementations must:
Use a variant of the procedure described here [[Nova Ordis Utilities Version Metadata Handling]], with the difference that the resource file has an extension-specific name (example: "jboss-datagrid-7-extension-version") and call VersionUtilities.getVersion(<extension-specific-resource-file-name>) instead.
 
1. Declare a static final String similar to:
 
<pre>
public static final String VERSION = "${project.version}";
</pre>
 
2. Override Service.getVersion():
 
<pre>
@Override
public String getVersion() {
   
    return VERSION;
}
</pre>
 
3. Turn on resource plugin filtering on the Service implementation source file, as shown below:
 
For more details on resource plugin filtering see the [[Maven Resources Plugin|resources plugin]].

Revision as of 03:47, 22 December 2016

Internal

Overview

cd projects/gld/extensions/<extension-name>
release snapshot

The above will build the extension and install it in ${RUNTIME_DIR}/gld/extensions. The location of the installation directory can be configured in <extension-name>/.nort/project.yaml, as "install/installation.directory".

Extension Name

The extension name, as described by the "gld Concepts - Extension Name" section, must be specified as the "extension.name" property in the extension project POM:

<project ...>
    ...
    <properties>

        <extension.name>jboss-datagrid-7</extension.name>

        ...
    </properties>
   ...
</project>

The POM "extension.name" property is the authoritative source of information for extension name, and it will be inferred from it everywhere extension name is necessary.

For simplicity, it is recommended that the extension top-level directory of the extension project has the same name as "extension.name".

Extension Version

Use a variant of the procedure described here Nova Ordis Utilities Version Metadata Handling, with the difference that the resource file has an extension-specific name (example: "jboss-datagrid-7-extension-version") and call VersionUtilities.getVersion(<extension-specific-resource-file-name>) instead.