【发布时间】:2011-04-03 17:03:36
【问题描述】:
我正在尝试将 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>
构建这个项目会导致同样的错误。
我测试过的其他东西:
- 尝试使用 Maven 2.2.1 和 3.0.3 的香草安装进行构建
- 让朋友在他的电脑上构建了测试项目,以排除我电脑上的本地问题
- 将版本从 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>
【问题讨论】:
标签: maven repository