25

I added the below depdencies in my pom

     <dependency>
        <artifactId>richfaces-api</artifactId>
        <groupId>org.richfaces.framework</groupId>
        <version>3.3.3.Final</version>
    </dependency>

      <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>3.3.3.Final</version>
    </dependency>

   <dependency>
        <artifactId>richfaces-impl</artifactId>
        <groupId>org.richfaces.framework</groupId>
        <version>3.3.3.Final</version>
    </dependency>

When I did mvn clean install in command prompt , these dependency jars got downloaded. However in Eclipse this is not showing under referenced libraries section. The other jar files that are part of dependencies are showing up though. Is there anything that I must do for this to get reflected? Thanks.

nwinkler
  • 52,665
  • 21
  • 154
  • 168
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
  • You might want to refersh the project/maven plugin(if your using it) created classpath container. – Puneet Apr 03 '12 at 08:30
  • 1
    Sometimes I have the same problem, I just restart the IDE and the new libraries arrive a little bit later – anvarik Apr 03 '12 at 08:31
  • What version of Eclipse are you using and do you use m2e or maven-eclipse-plugin? If you use m2e, a simple right-click on your project-->Maven-->Update depependencies... should do the trick (and it even downloads the jars for you) – Guillaume Polet Apr 03 '12 at 08:36
  • Hi Guillaume, I did update dependencies - but it is still not updating the dependencies. I am guessing it is not able to connect to central repo that I have specified. – Punter Vicky Apr 03 '12 at 09:41

5 Answers5

53

This depends on how you have integrated Maven in Eclipse:

  • No Eclipse integration: run mvn eclipse:eclipse on command line to refresh the project definition.
  • M2Eclipse or m2e: Update the POM file (select, press F5), then right-click the project, Maven > Update Dependencies

This should fix it.

nwinkler
  • 52,665
  • 21
  • 154
  • 168
  • 9
    It was Maven > Update Project ... on my version of m2e but yes that fixed it! Thank you! In my case, the jar files were being downloading and appearing in the lib dir but not appearing in the list of Dependencies in the Deployment Assembly. – crowmagnumb Mar 14 '14 at 21:40
  • 1
    fyi.. for people looking at option 2 from this answer. Check http://stackoverflow.com/questions/9665569/where-did-eclipses-run-as-maven-package-go – mtk Jul 22 '14 at 10:04
  • 4
    I am using eclipse mars, In this new version of eclipse you need to do right-click the project, Maven > Update project. – Hasmukh Barochiya Jan 22 '16 at 06:01
6

there are two things, you can do: a) use a plugin like m2eclipse b) call mvn eclipse:eclipse

The first approch will make eclipse work with maven. The second one will create a .project and a .classpath file. You have to call mvn eclipse:eclipse everytime you change the maven dependencies.

From my point of view, the second approch is better, because I got into some serious trouble with m2eclipse and multimodule projects.

update:

As far as I define compatibility, eclipse is not maven compatible, because it does not seperate the different classpathes of maven. Other IDE are better (in this aspect).

Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
3

Right click on the project ->

Properties -> Deployment Assembly -> Add -> Java Build Path Entries ->

choose maven deps -> finish -> click ok

or simply run below command and let maven generate eclipse files

mvn eclipse:eclipse
fmucar
  • 14,361
  • 2
  • 45
  • 50
1

Another possibility I tripped over today, is if you accidentally set compile:compile to ignore - I've no idea how I did it but to fix it go to Window->Preferences->Maven->Life Cycle Mappings, open the file it points to and remove all the pluginExecution elements that say

  <action>
    <ignore />
  </action>
Ian Turton
  • 10,018
  • 1
  • 28
  • 47
1

Follow the following steps to fix this issue

  • Right-click on project
  • Navigate to Maven
  • Click on Update Project Then I will download all required dependencies
AnkitSingh
  • 71
  • 1
  • 1
  • 9