Why hello Peter,

Which version are you using?

The reason those dependencies are declared are because things like Jetty
use them -and the classpath for the server side Hadoop is "things needed to
run Hadoop".

Client-side I think there's too much in the maven dependency tree
(servlets, jetty, ...)



On 29 October 2013 19:22, Petar Tahchiev <paranoia...@gmail.com> wrote:

> Hi guys,
>
> I'm using Spring-data-solr in my project. SDS declares Solr-core as a
> dependency. Solr declares hadoop-auth, hadoop-common, hadoop-hdfs
> dependencies. Each and every one of those dependencies declares log4j and
> slf4j-log4j12 as runtime dependencies, and also hadoop-common declares
> servlet-api version 2.5 as runtime dependency. So in the end I also get
> servlet-api 2.5, slf4 and log4j in my classpath.
> This normally shouldn't be a problem, but in my case I'm using Servlet 3.0,
> log4j2, and SL4j for log4j2. This completely messes up my classpath, so I
> have to manually exclude those dependencies, like this:
> -----------------------------------------------
>         <dependency>
>             <groupId>org.apache.solr</groupId>
>             <artifactId>solr-core</artifactId>
>             <version>${solr.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>org.slf4j</groupId>
>                     <artifactId>slf4j-jdk14</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.apache.solr</groupId>
>                     <artifactId>solr-core</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.solr</groupId>
>             <artifactId>solr-core</artifactId>
>             <version>${solr.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>org.apache.hadoop</groupId>
>                     <artifactId>hadoop-auth</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.apache.hadoop</groupId>
>                     <artifactId>hadoop-common</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.apache.hadoop</groupId>
>                     <artifactId>hadoop-hdfs</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.hadoop</groupId>
>             <artifactId>hadoop-auth</artifactId>
>             <version>${hadoop.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>log4j</groupId>
>                     <artifactId>log4j</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.slf4j</groupId>
>                     <artifactId>slf4j-log4j12</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.hadoop</groupId>
>             <artifactId>hadoop-common</artifactId>
>             <version>${hadoop.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>log4j</groupId>
>                     <artifactId>log4j</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.slf4j</groupId>
>                     <artifactId>slf4j-log4j12</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.servlet</groupId>
>                     <artifactId>servlet-api</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.hadoop</groupId>
>             <artifactId>hadoop-hdfs</artifactId>
>             <version>${hadoop.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>log4j</groupId>
>                     <artifactId>log4j</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>org.slf4j</groupId>
>                     <artifactId>slf4j-log4j12</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.servlet</groupId>
>                     <artifactId>servlet-api</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
> ---------------------------------------------------
> Just out of curiosity here - what is the reason to include log4j,
> slf4j-log4j12 and servlet-api as runtime dependencies? I think they should
> be with scope provided. It's good to program your API against slf4j, but
> then the connector should be specified by the user (Log4J2 in my case).
> Also are there any plans to migrate to Log4J2 - it seems pretty solid (9
> betas so far) and It is supposed to be released soon.
>
> Thanks for you time and keep up the good work.
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
> ---
> Public PGP Key at:
> https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Reply via email to