1

I checked out an existing eclipse project from SVN. Then I converted it to Maven project. The project is compile with Maven target clean install perfectly no problem. But the eclipse doesn't identify any dependency jar file. Basically it does not know the Maven repo path. It knows only JDK path. So all my java classes are with full of red lines.

Everything in this site and google I checked all fine. But why eclipse can not find the mvn repo? eclipse version = JUNO Version: 4.2.2. ( I think this has inbuilt maven plugin) Maven plugin detail = M2E - Maven Integration for Eclipse version - 1.4.0, Provider - Eclipse.org -m2e

enter image description here

UPDATE ======================

If I checkout the source code separately and import it as a maven project that way its working. But I want to know why if I checkout the code through Subclipse and convert it to maven project is not working?

user2771655
  • 1,052
  • 3
  • 20
  • 38

2 Answers2

3

Run

# use maven to control your eclipse .project and .classpath files, that is
mvn eclipse:clean
mvn eclipse:eclipse

and then restart your eclipse (or switch your workspace and then back).

Make sure you have the m2e plugin, - from here, you should read the Release Notes and add this to your update sites - "http://download.eclipse.org/releases/juno" and "http://download.eclipse.org/technology/m2e/releases".

Community
  • 1
  • 1
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
0

In Eclipse, you can actually create an external tool Run> External Tools> External Tools Configurations. After this you can select your project that you want to setup and run this external tool.

eclipse_eclipse

or if you have maven plugin installed in eclipse, select your project right click Run As > Maven Build... (see below image). In Goals put "eclipse:eclipse" and click Run

enter image description here

Nitin Dandriyal
  • 1,559
  • 11
  • 20
  • can you please post the error trail that you are getting.. Its fairly straight forward to setup eclipse project using this. – Nitin Dandriyal Nov 18 '13 at 04:39
  • Basically the problem is Java build path does not know the Dependent jars(maven local repo). So my code has errors. But I can build it without any problem. If you see my screen grab you can understand. – user2771655 Nov 18 '13 at 04:53
  • then please have a look at the .classpath file that got generated after running this plugin. – Nitin Dandriyal Nov 18 '13 at 06:39