Attached to this document is a tool that analyzes an add-on package (i.e. the zip file or directory) and reports on any potential problems it finds.
- Most errors are reported along with the filename, line/column number, and quoted context relevant to that error.
- Exit codes are suitable for scripting: 0 - No Problems, 1 - Problems found, 2 - Did not run
- Verifies whether keys and values are supported by Jive and are appropriate to the minimum_version specified by the add-on.
Field checking is dependent on minimum_version (e.g. embedding files in /public/* is not permitted prior to Jive Version 8c4).
Resolves i18n keys to ensure they exist. Ensures defined i18n keys are resolvable in all supported locales. (--i18n)
Checks external URLs to ensure they return successfully, use valid certificates, and provide appropriate data. (--url)
Checks for extra files that cannot be used and only bloat the package size.
- Java Version 7 or 8.
java -jar add-on-validator.jar -ig <PACKAGE_FILENAME>
You can run this jar from the command line using the following command:
java -jar add-on-validator.jar <PACKAGE_FILENAME>
If you would like to see the help output, simply use the -h argument:
java -jar add-on-validator.jar -h
The following help output is displayed:
java -jar add-on-validator.jar [-iqu] [--i18n] [--quiet] [--url] [--ignore 10000,20000-29999] [--info | --warn | --error | --severe] [--timeout seconds] file1 [file2 ...] --error Report on errors that are ERROR or higher -i --i18n Check i18n references for consistency --ignore Ignore specific errors, by code 10000 A single 5 digit error code to ignore 20000-29999 A range of 5 digit error codes to ignore, inclusive --info Report on errors that are INFO or higher (default) -q --quiet Run quietly, no output --severe Report on errors that are SEVERE or higher --timeout Override the default timeout of 0.5s, use with -u seconds The number of seconds when checking external URLs -u --url Check external URLs (can be slow) --version Show the version of this tool --warn Report on errors that are WARNING or higher file The add-on package (zip) or a directory to test
Sample Success Output
Validation complete. No problems found.
Sample Warning Output
[WARNING:59907] Unsupported key in object: "jabCartridges" definition.json [15:5] : "jabCartridges":  [WARNING:33445] Incompatible file found, expecting JPEG_SCREENSHOT but found PNG : /data/screenshot_00.png meta.json [35:19] : ...": ["screenshot_00.png","screenshot_01.png","screenshot_02.png","screen... [WARNING:33445] Incompatible file found, expecting JPEG_SCREENSHOT but found PNG : /data/screenshot_03.png meta.json [35:85] : ...02.png","screenshot_03.png","screenshot_04.png"], [WARNING:59907] Unsupported key in object: "tags" meta.json [36:2] : "tags": [ "Example", [WARNING:90007] File /data/extension-24.png in package is superfluous [WARNING:90007] File /data/extension-32.png in package is superfluous [WARNING:10007] Directory extra/ is superfluous
Sample Error Output
[SEVERE:30004] Incomplete Jive package: definition.json not found
- Support for comparing key fields against those currently in the global registry
- All messages have a numeric code now, messages can be suppressed by code
- We now provide an integration API so the validator can be integrated with other code.***
- The validator now supports validation of cryptographically signed add-on packages
- Code is more efficient. File size reduced from 2.5mb to 1.6mb