Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to add custom component library in a project #62

Open
alexbudarov opened this issue Nov 5, 2019 · 0 comments
Open

Document how to add custom component library in a project #62

alexbudarov opened this issue Nov 5, 2019 · 0 comments
Assignees
Milestone

Comments

@alexbudarov
Copy link
Member

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants