java - Using HTTPClient in Grails 2.4 -
Trying to use HttpClient from Apache to use it on new and unity tests for Grails. Therefore I have this dependency: / P>
Dependency {// Here, specify dependence here under 'build', 'compile', 'runtime', 'test' or 'provided' scope. E.g. // runtime mysql: mysql-connector-java: 5.1.29 '// runtime' org.postgresql: postgresql: 9.3-1101-jdbc41 'test' org.grails: grails-datastore-test-support: 1.0-grails- 2.4 "Compile 'org.apache.httpcomponents: httpcore: 4.1.2' Compile 'org.apache.httpcomponents: httpclient: 4.1.2' build 'org.apache.httpcomponents: httpcore: 4.1.2' build 'org.apache. Httpcomponents: httpclient: 4.1.2 'test' org.apache.httpcomponents: httpcore: 4.1.2 'test' org.apache.httpcomponents: httpclient: 4.1.2 '} in build .config and test such as
class MyControllerTests GroovyTestCase {@Test void testApacheHttpClient () {def client = new HttpClient ()}} Can not because grails solve any class
I have tried with manual imports without success.
What am I doing wrong?
Thank you in advance.
A dependency in the form of Commons HttpClient It should be added to your dependency:
test 'commons-httpclient: commons-httpclient: 3.1' It may also be the correct class on your source code Be sure to import:
org.apache.commons.httpclient.HttpClient
Comments
Post a Comment