Hi Alain,

On Thu, 7 Jul 2022 at 11:35, Alain Désilets <alaindesile...@gmail.com> wrote:
> If you look at my pom, you can see that there is a filter in the
> configuration of the shade plugin that remove the Log4j2Plugins.dat files.
> This seems to work because
>
> jar -tf iutools-core-1.0.2-jar-with-dependencies.jar | grep Log4j2Plugins
>
>
> produces an empty list.
>
> So I think the problem lies elsewhere.

The removal of the `Log4j2Plugins.dat` files is exactly the source of
the problem. Log4j2 uses these files to load the list of available
plugins (like the Log4j 1.2 configuration factories), if it does not
find them it falls back to scanning the
`org.apache.logging.log4j.core` package. The plugins from
`log4j-1.2-api` are not in this package. Instead of deleting these
files you should merge them using the Maven shade plugin proposed by
Ralph.

As an alternative you can replace the `maven-shade-plugin` with the
`spring-boot-maven-plugin` that creates single JAR file applications
without squashing all jars into one:
https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#goals-repackage

Piotr

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to