Package com.globalmentor.application
Class BaseCliApplication.MetadataProvider
- java.lang.Object
-
- com.globalmentor.application.BaseCliApplication.MetadataProvider
-
- All Implemented Interfaces:
picocli.CommandLine.IVersionProvider
- Enclosing class:
- BaseCliApplication
protected static class BaseCliApplication.MetadataProvider extends java.lang.Object implements picocli.CommandLine.IVersionProviderStrategy for retrieving the application name and version from the configuration.This class expects a configuration file with the same name as the application class indicated in the constructor with a base extension of
-config, such asExampleApp-config.properties, loaded via Confound from the resources in the same path as the application class. For example:name=${project.name} version=${project.version}- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetadataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getVersion()
-
-
-
Method Detail
-
getVersion
public java.lang.String[] getVersion() throws java.lang.Exception- Specified by:
getVersionin interfacepicocli.CommandLine.IVersionProvider- Implementation Specification:
- This implementation retrieves the name from resources for the concrete application class using the resource key "version".
- Throws:
io.confound.config.ConfigurationException- if there was an error retrieving the configured name or the name could not be found.java.lang.Exception- See Also:
BaseCliApplication.CONFIG_KEY_VERSION
-
-