Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5950

In SolrJ's Maven Dependency Graph, slf4j-api is optional, which breaks plain solrj users

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.7, 4.7.1
    • 4.7.2, 4.8, 6.0
    • clients - java
    • None

    Description

      To run as a Solr Client, you need slf4j actually configured in your classpath, because HttpSolrServer hardly depends on it, also the used libs like Commons Httpclient (and others)

      In SOLR-3706 all of the slf4j JARs were made optional, but because we did not exclude the dependencies of httpclient and others explicitely, the dependency was still included by maven automatically for a user that used SolrJ - so effectively the "optional" was never working.

      In 4.7, steve_rowe now explicitely excluded all dependencies of all deps included via IVY. By that the implicit dependency by httpclient was killed.

      When I updated a project from SolrJ 4.6 to SolrJ 4.7, it suddenly failed to run, because it failed with a classnotfound ex directly after starting. Not even the default logging to console was enabled (which is provided by slf4j). This is bad for users of SolrJ, because they have to explicitely add a dependency for something that really required to use SolrJ.

      The reason for excluding slf4j-api was that we don't want to have it in the WAR file, so it was made optional. But that is wrong:

      • In trunk we no longer have a WAR file
      • The primary user of SolrJ via Maven is not somebody who wants to install Solr in his appserver, its the user needing the client.

      So we should restore the state from Solr 4.6, where the dep was implicitely included, by making it non-optional in Maven.

      When building the WAR file in 4.x we should exclude it somehow via Maven Magic(tm).

      Attachments

        1. SOLR-5950.trunk.patch
          6 kB
          Steven Rowe
        2. SOLR-5950.patch
          2 kB
          Steven Rowe
        3. SOLR-5950.branch_4x.patch
          7 kB
          Steven Rowe

        Issue Links

          Activity

            People

              sarowe Steven Rowe
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: