Apache组件和Spring Boot

时间:2015-04-30 20:51:32

标签: apache gradle spring-boot httpclient apache-httpclient-4.x

我试图在我的spring启动应用程序中包含最新版本的apache httpclient库。当我尝试编译应用程序时,我得到一堆包不存在/无法找到符号。

ex.  error: package org.apache.http does not exist
ex.  error: package org.apache.http.client.config does not exist
ex.  error: package org.apache.http.conn.socket does not exist
ex.  class HttpContext cannot find symbol

以下是build.gradle的相关部分

buildscript {
repositories {
maven { url "https://repo.spring.io/libs-release" }
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE")
}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'

repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.spring.io/libs-release" }
}

dependencies {
compile("org.springframework.boot:spring-boot-starter-web") {
//excluding a particular transitive dependency:
exclude group: 'commons-logging' //by group
exclude group: 'ch.qos.logback' //by group
}

compile 'org.apache.httpcomponents:httpclient:4.4'
compile 'org.apache.httpcomponents:httpcore:4.4'
compile 'org.apache.httpcomponents:httpmime:4.4.1'
}

task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}

知道为什么id似乎无法找到这些类?

谢谢, 森

0 个答案:

没有答案