Punter Vicky
Punter Vicky

Reputation: 17032

Maven Dependencies Eclipse

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.

Upvotes: 26

Views: 91603

Answers (5)

AnkitSingh
AnkitSingh

Reputation: 71

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

Upvotes: 1

Ian Turton
Ian Turton

Reputation: 10976

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>

Upvotes: 1

fmucar
fmucar

Reputation: 14558

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

Upvotes: 3

Christian Kuetbach
Christian Kuetbach

Reputation: 16060

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).

Upvotes: 6

nwinkler
nwinkler

Reputation: 54477

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.

Upvotes: 53

Related Questions