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:
- Create a new workspace in Helios
- Create a new Tomcat 5.5 server
- Import a copy of the old Eclipse 3.1 project (Import... > General > "Existing Projects into Workspace")
- Edit the new .project file to include the correct "Natures" for the project
- 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:
- Open Helios, start a new (i.e. EMPTY) workspace
- Create a New project, select "Dynamic Web Project"
- Say "Yes" to "Create a local webserver", configure your webserver runtime environment, etc.
- Click "Next >" through the 'add source folders' step
- Click "Finish"
- 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 theWEB-INF
folder in the WebContent node of your Dynamic Web Project - Last, drag the contents of
WEB-INF\src
to the "src
" folder under the Java Resources node of your Dynamic Web Project - 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!
You have two options:
- migrate the projects using eclipse built-in features as @megathor and @Tristan described
- 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 :-)
You should use Eclipse "add nature" dialogs instead of "4. Edit the new .project file to include the correct "Natures" for the project"
You should just import the project into the Helios workspace, go to the project properties, select the "Project Facets" add all the facets needed, choose Tomcat as runtime environment (I recommend you to add Tomcat as a server in Window -> Preferences -> Server -> Runtime Environments first). After this you should be able to choose Run On Server to see your application deployed to Tomcat...
精彩评论