Maven在存储库中找不到httpcomponents-client

Ola*_*sby 19 repository maven

我正在尝试将Apache httpcomponents-client库添加到我的Maven项目中.我已经添加了对pom.xml的依赖(在http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcomponents-client/4.1.1上找到),但在构建我的Eclipse项目时,Maven无法找到并且下载库.

我做了一个测试项目,除了包含这个库之外什么都不做,以确保它不是导致问题的任何其他设置:

<?xml version="1.0"?>
<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>no.gundelsby.test</groupId>
<artifactId>NeedMyPackage</artifactId>
<version>0.1</version>
<dependencies>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcomponents-client</artifactId>
        <version>4.1.1</version>
    </dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

构建此项目会导致相同的错误.

我测试的其他东西:

  • 尝试使用Maven 2.2.1和3.0.3的vanilla安装
  • 有朋友在他的计算机上构建测试项目以排除我计算机上的本地问题
  • 将版本从4.1.1更改为4.1

对于它的价值我几天前使用org.easytesting.fest-swing遇到同样的问题,请参阅下面的pom依赖条目:

<dependency>
    <groupId>org.easytesting</groupId>
    <artifactId>fest-swing</artifactId>
    <version>1.2.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

Zac*_*son 30

您不希望httpcomponents-client作为依赖项.这只是客户端相关模块的父pom.我怀疑你真的想要<artifactId>httpclient</artifactId>.