rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Upgrade dependency on Apache HttpClient #241

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client (e.g. 1.15.0-rc)?

1.16.0-rc

Java environment (e.g. Java 6, Android 2.3, App Engine)?

JDK6, Mac.

Describe the problem.

If I use your library with Selenium 2.34, under Maven control, I get a 
NoClassDefFound error in Selenium as Maven chooses your older version of Apache 
HttpClient.

[INFO] +- org.seleniumhq.selenium.fluent:fluent-selenium:jar:1.12:test
[INFO] |  \- org.seleniumhq.selenium:selenium-java:jar:2.34.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-android-driver:jar:2.34.0:test
[INFO] |     |  \- 
org.seleniumhq.selenium:selenium-remote-driver:jar:2.34.0:test
[INFO] |     |     +- cglib:cglib-nodep:jar:2.1_3:test
[INFO] |     |     +- org.json:json:jar:20080701:test
[INFO] |     |     \- com.google.guava:guava:jar:14.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.34.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.34.0:test
[INFO] |     |  \- net.sourceforge.htmlunit:htmlunit:jar:2.12:test
[INFO] |     |     +- xalan:xalan:jar:2.7.1:test
[INFO] |     |     |  \- xalan:serializer:jar:2.7.1:test
[INFO] |     |     +- commons-collections:commons-collections:jar:3.2.1:test
[INFO] |     |     +- org.apache.commons:commons-lang3:jar:3.1:test
[INFO] |     |     +- org.apache.httpcomponents:httpmime:jar:4.2.3:test
[INFO] |     |     +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:test
[INFO] |     |     +- xerces:xercesImpl:jar:2.10.0:test
[INFO] |     |     |  \- xml-apis:xml-apis:jar:1.4.01:test
[INFO] |     |     +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:test
[INFO] |     |     +- net.sourceforge.cssparser:cssparser:jar:0.9.9:test
[INFO] |     |     |  \- org.w3c.css:sac:jar:1.3:test
[INFO] |     |     \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:test
[INFO] |     |        +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:test
[INFO] |     |        +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:test
[INFO] |     |        \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:test
[INFO] |     +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.34.0:test
[INFO] |     |  +- commons-io:commons-io:jar:2.2:test
[INFO] |     |  \- org.apache.commons:commons-exec:jar:1.1:test
[INFO] |     +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.34.0:test
[INFO] |     |  +- net.java.dev.jna:jna:jar:3.4.0:test
[INFO] |     |  \- net.java.dev.jna:platform:jar:3.4.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.34.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.34.0:test
[INFO] |     +- org.seleniumhq.selenium:selenium-support:jar:2.34.0:test
[INFO] |     |  \- org.seleniumhq.selenium:selenium-api:jar:2.34.0:test
[INFO] |     \- org.webbitserver:webbit:jar:0.4.14:test
[INFO] |        \- io.netty:netty:jar:3.5.2.Final:test
[INFO] \- com.google.http-client:google-http-client:jar:1.16.0-rc:test
[INFO]    +- com.google.code.findbugs:jsr305:jar:1.3.9:test
[INFO]    +- org.apache.httpcomponents:httpclient:jar:4.0.1:test
[INFO]    |  +- org.apache.httpcomponents:httpcore:jar:4.0.1:test
[INFO]    |  +- commons-logging:commons-logging:jar:1.1.1:test
[INFO]    |  \- commons-codec:commons-codec:jar:1.3:test
[INFO]    \- xpp3:xpp3:jar:1.1.4c:test

How would you expect it to be fixed?

Upgrade deps to 4.2.3 or thereabouts :)

Original issue reported on code.google.com by paul@hammant.org on 13 Aug 2013 at 5:05

GoogleCodeExporter commented 9 years ago
Yeah, we should probably update the dep version.  But it's not urgent, because 
you can override the version that Maven uses.

That said, we must still adhere to compatibility with Apache HTTP Client 4.0.1 
just because that's the version Android has included in their SDK.

While we're thinking about ApacheHttpTransport, we might also think about 
whether to move it to a separate artifact google-http-client-apache like we've 
done for managing third-party library dependencies in other cases (e.g. 
google-http-client-jackson).  I can't think of any obvious problem that it 
would solve per se, but it least it would limit the issue of the Apache HTTP 
Client dependency to only developers that actually want to use 
ApacheHttpTransport.

Original comment by yan...@google.com on 13 Aug 2013 at 9:36

GoogleCodeExporter commented 9 years ago
<dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client</artifactId>
      <version>1.16.0-rc</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

worked for me :)

Original comment by paul@hammant.org on 13 Aug 2013 at 10:05

GoogleCodeExporter commented 9 years ago
By the way, In your Maven POM, if ApacheHttpTransport is truly optional, you 
could add <optional>true</optional> as a way of not forcing downstream users to 
consume it transitively..

Original comment by paul@hammant.org on 13 Aug 2013 at 10:17

GoogleCodeExporter commented 9 years ago

Original comment by ngmic...@google.com on 19 Aug 2013 at 8:25

GoogleCodeExporter commented 9 years ago
There is a discussion here of optional dependencies:
http://maven.apache.org/guides/introduction/introduction-to-optional-and-exclude
s-dependencies.html

I don't like optional because then the dependency won't get automatically 
included when you do want to use the optional feature.  I think in that case we 
would be better off making a new separate artifact for that functionality 
(google-http-client-apache).

Original comment by yan...@google.com on 19 Aug 2013 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 27 Sep 2013 at 11:57