masquerade
masquerade copied to clipboard
Document how to add custom component library in a project
see forum answer: https://www.cuba-platform.com/discuss/t/masquerade-appmenu-openitem/10518/4?u=alexbudarov
You should register you custom config using Java ServiceLoader rules: https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html
Deploying service providers on the class path
A service provider that is packaged as a JAR file for the class path is identified by placing a provider-configuration file in the resource directory META-INF/services . The name of the provider-configuration file is the fully qualified binary name of the service. The provider-configuration file contains a list of fully qualified binary names of service providers, one per line.
For example, suppose the service provider com.example.impl.StandardCodecs is packaged in a JAR file for the class path. The JAR file will contain a provider-configuration file named:
Copy
META-INF/services/com.example.CodecFactory
Here you should use filename equal to FQN of ComponentConfig class.
that contains the line:
Copy
com.example.impl.StandardCodecs # Standard codecs
And here you need to use FQN of your custom config.