On Thu, Jan 16, 2020 at 02:03:06AM +0000, Wolf, Chris (ELS-CON) wrote:
[snip]
> There are several issues:
> 
>   1.  I don’t want log4j-slf4j-impl at all
>   2.  Somehow the version of “log4j-slf4j-impl” being used for the build is 
> 2.7 rather then the expected 2.11.0
>   3.  Due to the version issue, the app croaks with ClassNotFoundException: 
> org.apache.logging.log4j.util.ReflectionUtil
> 
> For issue #1, I tried:
>   <dependency>
>       <groupId>org.apache.solr</groupId>
>       <artifactId>solr-core</artifactId>
>       <version>7.5.0</version>
>       <exclusions>
>         <exclusion>
>           <artifactId>org.apache.logging.log4j</artifactId>
>           <groupId>log4j-slf4j-impl</groupId>
>         </exclusion>
>       </exclusions>
>     </dependency>
> 
> All to no avail, as that dependency ends up in the packaged build - for WAR, 
> it’s version 2.11.0, so even though it’s a bad build, the app runs, but for 
> building a spring-boot executable JAR with embedded webserver, for some 
> reason, it switches log4j-slf4j-impl from version 2.11.0  to 2,7 (2.11.0  
> works, but should not even be there)
> 
> I also tried this:
> https://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/exclude-dependency.html
> 
> …that didn’t work either.
> 
> I’m thinking that solr-core should have added a classifier of “provided” for 
> “log4j-slf4j-impl”, but that’s conjecture of a possible solution going 
> forward, but does anyone know how I can exclude  “log4j-slf4j-impl”  from a 
> spring-boot build?

It looks to me as though solr-core is not the only artifact with that
dependency.  The first thing I would do is examine the output of 'mvn
dependency:tree' to see what has dragged log4j-slf4j-impl in even when
it is excluded from solr-core.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu

Attachment: signature.asc
Description: PGP signature

Reply via email to