Small changes to that: * Should move the XML configuration format to its own module, too, for the java.xml dependency * Should remove the Jackson JSON configuration format as we have a dependency-free JSON format in core (the YAML format support is based on the Jackson JSON support, so this code can be simplified to only supporting YAML)
> On Nov 29, 2023, at 5:49 AM, Piotr P. Karwasz <piotr.karw...@gmail.com> wrote: > > Hi all, > > I have been using a modularized sandbox project to test Log4j and > optional dependencies are a nightmare. > > Small example: if I use Log4j API in my project and I add: > > requires org.apache.logging.log4j; > > then when I run the app, the JVM will automatically add `log4j-api` to > the boot layer. > > It will also add `log4j-core`, since it provides a service that > `log4j-api` uses. > > However it will **not** load `jackson-datatype-yaml`, because it is an > **optional** dependency of `log4j-core` and provides no services > `log4j-core` is interested in. The user must go to the additional pain > of specifying `--add-modules` or the application developer must add a > bogus `requires` statement. > > Therefore I would propose to: > > * move the YAML configuration factory to a separate module and delete > one of the JSON configuration factories (the one that uses Jackson). > > What do you think?