Loading more than one extension


We are currently using druid with mysql extension (through maven) and also added a custom one.

Inside the mysql-extension jar we have the file META-INF/services/io.druid.initialization.DruidModule which is the same as what we need to add for our custom extension (custom aggregator)

Luckily the first file is overwritten by the second one so adding both modules in our custom extension worked. But we would like to know if there is a better way to solve this.

Thank you

Hey Juan,

Ordinarily the different extensions are loaded from separate jars so this is not typically an issue. Is the services file getting overwritten because you’re building a single self-contained assembly jar? If so, the program you’re using to make the self-contained jar should have some way of telling it that you want it to concatenate the files rather than having them clobber each other.

For example if you’re using the maven shade plugin, you could add a transformer:


Hi Gian, exactly what you said, and your solution worked perfectly!

Thank you,