Maven dependency

Hi
I read many threads about maven and IntelliJ but I cannot find solution for my problem. I have a maven project and I see that needed library was downloaded:
Selection_011.png
library - Maven:org.apache.httpcomponents - httpcore
In this library is package org.apache.http but the editor does not see it.

I can run "clean package" and package is created without any problems.
Project was imported from Eclipse.

Could someone help me?

6 comments
Comment actions Permalink

Please try File | Invalidate Caches | Invalidate and Restart.

If the issue remains, please provide a sample project illustrating the problem and the exact steps to reproduce.

0
Comment actions Permalink

Thank you for answer. Cleaning resolve 90% problems with dependencies but I  still have problem with org.apache.httpcomponents httpcore
This same pom works in Eclipse. Unfortunately I can attache only pom.xml - maybe the source of the problem is there



Attachment(s):
pom.xml
0
Comment actions Permalink

You have 2 different versions in the dependencies. Is that by design? Maybe you need only one?

 <dependency>
 <groupId>org.apache.httpcomponents</groupId>
 <artifactId>httpclient</artifactId>
 <version>4.3.5</version>
 </dependency>
 <dependency>
 <groupId>org.apache.httpcomponents</groupId>
 <artifactId>httpcore</artifactId>
 <version>4.3.2</version>
 </dependency>

0
Comment actions Permalink

I removed the second dependency - I added it when I was trying to solve the problem
Unfortunatelly the problem still exists.
When I use this pom in sample project I do not have problem with dependecy in the editor.

0
Comment actions Permalink

Try to remove .idea directory and .iml files from the project when IDEA is not running, then reimport the project from Maven.

0
Comment actions Permalink

Thank you very much - previously I imported project and next I added maven nature. This time I selected pom.xml during the import process and checked "Import Maven projects automatically".
Everything looks correct - thank you again for help. I can start using IntelliJ instead Eclipse :)

0

Please sign in to leave a comment.