views:

194

answers:

3

My Eclipse recently broke completely and I have upgraded to Galileo. I have created a fresh workspace (say foo/workspace) and created a trivial project. I have then copied an old project from (bar/workspace/myproject) to foo/workspace/myproject. It is mavenised and has a pom.xml. How do I tell Eclipse to build it (it does not seem to recognise it is mavenised). Do I have to install the maven plugin?

In general what is the smoothest way to reinstall Eclipse (i.e. what else do I need to think about?)

+3  A: 

It is better to reference directly your old workspace when starting your new eclipse installation: see this eclipse.ini

-data
c:/a/path/to/your/old/workspace

That way, you get back all your projects.

You can install the m2eclipse maven plugin by adding its update site to the list of sites examined by the eclipse p2 provisioning mechanism

http://m2eclipse.sonatype.org/update/
VonC
+3  A: 
  1. I never create or checkout a project directly under the Workspace but rather use something like ~/Projects for all my projects. This allows me to remain IDE independent. Actually, I never use any IDE to create a project.

  2. I share my workspace location across several Eclipse install (specified at startup or using -data). If anything goes wrong, I don't mind deleting and loosing my workspace, it doesn't contain anything really important anyway.

  3. Use the m2eclipse Eclipse plugin to Import > Maven Projects into Eclipse. Another option is to use the maven eclipse plugin to generate the .project and .classpath from the command line and then to Import > Existing Projects into Workspace from Eclipse.

Pascal Thivent
I do agree with those points, especially the 1. +1
VonC
+1 very useful. After re-installing maven (which I think had to be done manually) the Import maven projects was very easy.
peter.murray.rust
+1  A: 

If the metadata associated with your workspace is messed up, and it sounds like it is, the easiest thing to do is simply delete the .metadata folder from the workspace (or rename it to something else). Start up Eclipse, it will show an empty workspace, and then use File -> Import to import existing projects back into your workspace. Just point it to the folder of the existing project and it will do the right thing, leaving the project in place.

For the maven stuff, the Import Maven projects mentioned above seems right and probably does some other stuff to have maven work out.

Francis Upton
+1 thanks. Yes, the metadata was messed up and I deleted the `.metadata` folder. However I didn't know about the File->Import so got messed up again
peter.murray.rust
I only learned about the File->Import stuff recently and it's very useful.
Francis Upton