I started a new maven project in IntelliJ IDEA.

I added the following dependency to the pom

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2.5</version>
    </dependency>

Unfortunately the dependent

httpcore

is not resolved automatically, so i can not access classes like

HttpEntity

or

HttpResponse

When i add httpcore to the pom everything works fine.

What is the problem here? Do i really have to add this manually?

有帮助吗?

解决方案

I have had this problem with IntelliJ IDEA 11. For me, I had to force import of all artifacts:

Click the Maven tag to the right in IDEA. At the top you have an option ("Reimport all Maven projects" or similar). Click that, and hopefully the artifacts will get downloaded.

Also, check that you don't run maven in offline mode (no artifacts will be downloaded). There is an icon for this option in the Maven tab aswell.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top