- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下依赖项已添加到我的 pom.xml
中文件,但 Java 无法解析导入的类。
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
<type>jar</type>
</dependency>
httpcomponents
jar 存在于我的本地 Maven 存储库中(在 ~/.m2/repository/org/apache/httpcomponents
中),但我可以在 Eclipse 中看到它没有显示在 Maven 依赖项中。
通常的错误仍然存在。
The import org.apache.http.entity.mime cannot be resolved
我认为我犯了一些愚蠢的错误/忽略了某些内容(例如,我是否需要在 pom.xml
文件中添加第三方存储库?)
编辑
完整pom.xml
文件如下。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bl</groupId>
<artifactId>recording</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>recording</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.4.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.4.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc-portlet</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>xuggle</groupId>
<artifactId>xuggle-xuggler</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.26</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.4</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>xmlsec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>org.functionaljava</groupId>
<artifactId>functionaljava</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.thetransactioncompany</groupId>
<artifactId>cors-filter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>thirdparty-releases</id>
<name>JBoss Thirdparty Releases</name>
<url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
</repository>
<repository>
<id>xuggle repo</id>
<url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url>
</repository>
<repository>
<id>google-releases</id>
<name>Google Releases</name>
<url>https://oss.sonatype.org/content/repositories/google-releases</url>
</repository>
</repositories>
</project>
最佳答案
尝试使用
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>
相反。
(复制自 http://search.maven.org/#artifactdetails%7Corg.apache.httpcomponents%7Chttpclient%7C4.3.2%7Cjar )
关于java - 无法解决 Maven 中的 httpComponent 依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21903881/
我需要一些帮助,澄清如何将 HttpAsyncClient 与多部分实体一起使用。基本上,我正在尝试使用 HttpAsyncClient 将文件 (byte[]) 的内容上传为 MultiPart B
我有一个包含 HTTP header 的字符串。我想将其转换为 Apache HttpComponents HttpRequest 对象。有没有一种方法可以做到这一点,而无需自己拆开字符串? 本教程:
如何使 http 组件中的调试日志静音? 09:23:22.145 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selec
使用我在这里找到的代码:http://hc.apache.org/httpcomponents-client-ga/quickstart.html我创建了一个快速 HTTP 客户端应用程序。这是一个代
我正在尝试学习如何使用 Apache HttpComponents 发送 HttpResponse。我发现some examples在 Apache 网站上,但它们非常困惑且不清楚。 在下面的代码中,
我找不到任何关于 httpclient 4.1 的默认 httpParams 的文档? 执行 GET 时的默认套接字超时是多少? 最佳答案 根据documentation ,http.socket.t
我正在尝试将 Apache httpcomponents-client 库添加到我的 Maven 项目中。我已经向 pom.xml 添加了一个依赖项(在 http://mvnrepository.co
只是尝试在Android应用中发出一些POST请求。我正在用独立脚本中的HttpClient 4.5.3(https://hc.apache.org/downloads.cgi)测试。一切正常,但是当
我当前正在运行一个程序,该程序将使用 Apache HttpComponents 从网站下载源代码。我将下载很多(10,000 个),因此我使用多个线程来执行此操作。 有时所有线程都会死亡(加入),有
我最近从 java.net 切换过来至org.apache.http.client ,我设置了一个 ClosableHttpClient与 HttpClientBuilder 。作为连接管理器,我使用
我已经构建了一个 Storm 拓扑,它通过 kafka-spout 从 Apache-Kafka 接收元组,将此数据(使用另一个 Bolt)作为字符串写入本地系统上的 .txt 文件中,并从之后是我的
在 Android 上使用和选择发出 HTTP(S) 请求的方式是一个长期的痛苦。 虽然 Google 希望我们使用 HttpURLConnection,但有些人更喜欢使用 HttpClient。 有
我遇到了有关使用 apaches httpcomponents 进行基于证书的身份验证的问题。每次我启动请求时,我都会收到响应代码 403。如果我关闭 ssl 加密和身份验证,则可以成功建立连接。 我
根据 http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client
我正在编写一个 Java 程序,它使用 Apache-HttpComponents 加载页面并将其 HTML 打印到控制台;但是,该程序在抛出此错误之前仅打印了部分 HTML:每次我运行该程序时,在这
我想用 Apache http-components (4.1.2) 执行这个命令 curl --data "strings[]=testOne&string-keys[]=test.one&st
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
我想获取网站的 html,就像使用浏览器浏览一样。 当我尝试获取网站的 html 时,它与我使用 chrome 时的情况不同,我想知道是否可以使用 apache 的 HttpComponents 发出
我目前正在尝试让 HttpComponents 发送 HttpRequest 并检索响应。在大多数 URL 上,这都可以正常工作,但是当我尝试获取 phpBB 论坛的 URL 即 http://www
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我是一名优秀的程序员,十分优秀!