vert-x3 / vertx-config

Vert.x Configuration Service
Apache License 2.0
54 stars 64 forks source link

[Git config store] META-INF conflicts #64

Closed Trumeet closed 5 years ago

Trumeet commented 5 years ago

When I implemented both vertx-config and vertx-config-git components, the original resources/META-INF/services/io.vertx.config.spi.ConfigStoreFactory file in vertx-config is overridden by the file in vertx-config-git which has the same name. That causes I can't use the original config stores which defined in vertx-config (java.lang.IllegalArgumentException: unknown configuration store implementation: directory (known implementations are: [git])).

The temporary solution is to write a file which contains class names in ConfigStoreFactory files in two components to override them:

# Should be stored in your project resources/META-INF/services/io.vertx.config.spi.ConfigStoreFactory

# Original class names in vertx-config
io.vertx.config.impl.spi.FileConfigtoreFactory
io.vertx.config.impl.spi.JsonConfigStoreFactory
io.vertx.config.impl.spi.EnvVariablesConfigStore
io.vertx.config.impl.spi.SystemPropertiesConfigStore
io.vertx.config.impl.spi.HttpConfigStoreFactory
io.vertx.config.impl.spi.EventBusConfigStoreFactory
io.vertx.config.impl.spi.DirectoryConfigStoreFactory

# Additional class name in vertx-config-git
io.vertx.config.git.GitConfigStoreFactory

The version I'm using is 3.6.0. Hope that helps!

cescoffier commented 5 years ago

Hello,

If you use the Vert.x Maven Plugin, it will automatically combine the 2 files. Otherwise, you need to configure your packaging process to compute a combined file or write one.

Le ven. 14 déc. 2018 à 01:01, Yuuta notifications@github.com a écrit :

When I implemented both vertx-config and vertx-config-git components, the original resources/META-INF/services/io.vertx.config.spi.ConfigStoreFactory file in vertx-config is overridden by the file in vertx-config-git which has the same name. That causes I can't use the original config stores which defined in vertx-config (java.lang.IllegalArgumentException: unknown configuration store implementation: directory (known implementations are: [git])).

The temporary solution is to write a file which contains class names in ConfigStoreFactory files in two components to override them:

Should be stored in your project resources/META-INF/services/io.vertx.config.spi.ConfigStoreFactory

Original class names in vertx-config

io.vertx.config.impl.spi.FileConfigtoreFactory io.vertx.config.impl.spi.JsonConfigStoreFactory io.vertx.config.impl.spi.EnvVariablesConfigStore io.vertx.config.impl.spi.SystemPropertiesConfigStore io.vertx.config.impl.spi.HttpConfigStoreFactory io.vertx.config.impl.spi.EventBusConfigStoreFactory io.vertx.config.impl.spi.DirectoryConfigStoreFactory

Additional class name in vertx-config-git

io.vertx.config.git.GitConfigStoreFactory

The version I'm using is 3.6.0. Hope that helps!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-config/issues/64, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYjfelRRoSBYOSqSWWyWeVlHAOmRd9pks5u4upOgaJpZM4ZSplZ .

Trumeet commented 5 years ago

@cescoffier Is there a maven plugin for Vertx? That's great! I'll try to use it. Thanks.

cescoffier commented 5 years ago

@Trumeet here is the plugin: https://reactiverse.io/vertx-maven-plugin/