Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven can't find httpcomponents-client in repository

I am trying to add the Apache httpcomponents-client library to my Maven project. I have added a dependency to pom.xml (as found on http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcomponents-client/4.1.1), but when building my Eclipse project Maven is unable to find and download the library.

I have made a test project which does nothing but include this library to ensure that it's not any other settings that cause problems:

<?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>

Building this project results in the same error.

Other things I have tested:

  • Tried building with vanilla installs of both Maven 2.2.1 and 3.0.3
  • Had a friend build the test project on his computer to rule out local problems on my computer
  • Changed the version from 4.1.1 to 4.1

For what it's worth I had the same problem a few days ago with org.easytesting.fest-swing, see pom dependency entry below:

<dependency>
    <groupId>org.easytesting</groupId>
    <artifactId>fest-swing</artifactId>
    <version>1.2.1</version>
</dependency>
like image 383
Ola Christian Gundelsby Avatar asked Apr 03 '11 17:04

Ola Christian Gundelsby


1 Answers

You don't want httpcomponents-client as a dependency. That's just the parent pom for the client-related modules. I suspect you actually want <artifactId>httpclient</artifactId>.

like image 191
Zac Thompson Avatar answered Oct 14 '22 09:10

Zac Thompson