gradle shadowJar combine configuration files in HOCON format

559 views Asked by At

How can I combine application.con HOCON formatted files for lightben/typesafe configuration https://github.com/lightbend/config when creating a fat jar using gradle with the shadow plugin?

I.e. there are > 1 module which provide a application.conf file which need to be merged when creating a fat jar.

I would hope that something without additional code works i.e. that not a custom Transformer (https://imperceptiblethoughts.com/shadow/configuration/merging/) is required. There seems to exist one for XML https://github.com/johnrengelman/shadow/blob/f6ff6525c531b226f7faf44177ad5e6e7ef913b6/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/transformers/XmlAppendingTransformer.groovy#L44 but not yet for HOCON

1

There are 1 answers

1
Leo On BEST ANSWER

I think something like this Merging multiple TypeSafe Config files and resolving only after they are all merged but I am afraid you need to change your code.