Search code examples
javaeclipsetomcathelios

Moving Web App from Eclipse 3.1 to 3.6


I have a client's large-ish e-commerce web app that I've been developing for several years in Eclipse 3.1. To say the least, I'm ready to move on to Helios.

The web app runs on Tomcat 5.5 in Java 5.0.

The advice I've encountered so far presumes I'm starting a Dynamic Web Project from scratch, or from a WAR file. The best I've been able to do so far is:

  1. Create a new workspace in Helios
  2. Create a new Tomcat 5.5 server
  3. Import a copy of the old Eclipse 3.1 project (Import... > General > "Existing Projects into Workspace")
  4. Edit the new .project file to include the correct "Natures" for the project
  5. Restart Helios

At this point I try to add my web project as a resource to the Tomcat server Eclipse says there are no resources to add/remove.

Any advice on what my next step is, or an altogether better method for importing old web apps into Helios would be much appreciated!

UPDATE:

I chose the "clean" option suggested below, here's how I did it:

  1. Open Helios, start a new (i.e. EMPTY) workspace
  2. Create a New project, select "Dynamic Web Project"
  3. Say "Yes" to "Create a local webserver", configure your webserver runtime environment, etc.
  4. Click "Next >" through the 'add source folders' step
  5. Click "Finish"
  6. In the main project window, go back to a copy of the old source and select the contents of the WEB-INF folder, *except for the "src" (later step) and "classes" (not necessary) *; copy your selected files/folders to the WEB-INF folder in the WebContent node of your Dynamic Web Project
  7. Last, drag the contents of WEB-INF\src to the "src" folder under the Java Resources node of your Dynamic Web Project
  8. If your web app does not appear under the Tomcat server in the Servers tab at the bottom of the screen, right-click the server and select "Add and Remove..." -- your web project will positively be there

Thanks for the help and the downright sane advice from all the answer-ers!


Solution

  • You have two options:

    1. migrate the projects using eclipse built-in features as @megathor and @Tristan described
    2. build the project from scratch; create a new project (and workspace), modify the important artifacts (like web.xml) as required, and import your sources

    Although option #1 works fine in general, I recommend to proceed with option #2 as you get rid of all those artifacts not required any more. No question that it all depends of the complexity of your project and maybe your team size. Over the past years I've migrated a number of (more or less) complex applications from one eclipse IDE version to another. Creating a new, clean workspace and importing your sources from scratch does make sense - if there is a chance for cleanup make use of it :-)