Solr
  1. Solr
  2. SOLR-3411

Solrj doesn't have correct dependencies in pom

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: clients - java
    • Labels:
      None

      Description

      The the released pom for solrj 3.6.0 doesn't include the require dependency to httpclient 4.1.3. If I look to the grandparent, I can see that it is dependency managed, but it does appear as an actual dependency. When trying to use org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer, one gets a compile error:

      class file for org.apache.http.client.HttpClient not found
      solr = new ConcurrentUpdateSolrServer("http://localhost:8983/solr", QUEUE_SIZE, THREAD_COUNT);

      Putting the dependency in fixes the problem, but that isn't something the developer should have to do.

        Issue Links

          Activity

          Hide
          Steve Rowe added a comment -

          The httpclient dependencies are listed in the solrj POM as optional, so they are not transitive dependencies for users of solrj. This is intentional, to keep the dependency set small; some users of solrj will not need the httpclient dependency.

          Show
          Steve Rowe added a comment - The httpclient dependencies are listed in the solrj POM as optional, so they are not transitive dependencies for users of solrj. This is intentional, to keep the dependency set small; some users of solrj will not need the httpclient dependency.
          Hide
          Richard Frovarp added a comment -

          Got it. My confusion came in because commons-httpclient is included. I moved from the deprecated StreamingUpdateSolrServer to the not deprecated (and not HttpSolrServer from the pom comments) ConcurrentUpdateSolrServer and failed on compile. That too is dependent on the new httpclient.

          Show
          Richard Frovarp added a comment - Got it. My confusion came in because commons-httpclient is included. I moved from the deprecated StreamingUpdateSolrServer to the not deprecated (and not HttpSolrServer from the pom comments) ConcurrentUpdateSolrServer and failed on compile. That too is dependent on the new httpclient.
          Hide
          Ryan McKinley added a comment -

          3.x is in a middle ground – it includes two versions of the HTTP SolrServer one using httpclient and the other commons-http. in 4.x the commons-http version will get dropped.

          Show
          Ryan McKinley added a comment - 3.x is in a middle ground – it includes two versions of the HTTP SolrServer one using httpclient and the other commons-http. in 4.x the commons-http version will get dropped.
          Hide
          Michiel Verkaik added a comment -

          I ran into a dependency issue too when using the new HttpSolrServer class. I resolved by adding the following 2 dependencies to my POM:

          <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
          <version>4.1.3</version>
          </dependency>
          <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpmime</artifactId>
          <version>4.1.3</version>
          </dependency>

          Show
          Michiel Verkaik added a comment - I ran into a dependency issue too when using the new HttpSolrServer class. I resolved by adding the following 2 dependencies to my POM: <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.1.3</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.1.3</version> </dependency>

            People

            • Assignee:
              Steve Rowe
              Reporter:
              Richard Frovarp
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development