Open riojano0 opened 2 years ago
I prefer the option A, to mention that in the doc, would you like contribute ? :smile:
BTW, if you use https://start.vertx.io/, it has <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
defined to produce the fat jar.
Something like this?, https://github.com/vert-x3/vertx-config/pull/146 Please check my English is not the best
I missed checking the one created by the starter application, but nice that already have it
Case
When a fat-jar is created with maven following the current documentation and using multiple additional formats causes errors relate with that maven take only the first META-INF.services declared from the dependencies.
eg:
The io.vertx.config.spi.ConfigProcessor will be from the verxt-config ignoring the implementations from the yaml-lib
Two suggestions:
-A. Update readme relate to far-jars to acknowledge the user that uses maven with maven-shaded-plugin that needs to use the ServicesResourceTransformer to merge all the ServicesResource -B. Instead of each vertx-confi-{type} have their own io.vertx.config.spi.ConfigProcessor/ConfigStoreFactory update the core with all the Implementations.
A. Update Doc
Update https://vertx.io/docs/vertx-config/java/ telling to the user that when is create a fat-jar with maven-shade-plugin and additionals formats is needed to be define an extra transformer
Otherwise they only with keep with the last service that can have missing some Implementation given to the user errors like
java.lang.IllegalArgumentException: unknown configuration format: yaml (supported formats are: [json, raw, properties]
B. Move implementations declarations to core-lib
The vertx-config keeps all the implementations on her own META-INF and remove from the others additional-formats
eg
The previous suggestion is the "correct" one, but this other provides to the user an easy error to follow