posted 15 years ago
There is a way to convert JForum into a Dynamic Web Project. It involves manually adding additional <natures> to the .project file which allows the necessary facet configuration on the project's property page. Unfortunately though, JForum's directory setup is not entirely compatible with Eclipse's Dynamic Web Project support. The configuration of the docBase requires all deployment files to live in a sub-directory of the .project folder (default is "/WebContent"). In JForum, they're located at the project root level. Unless, you restructure the project layout this approach won't work.
Here's a more basic approach:
- After importing the .project into the workspace, add a new Server (right click in the Servers panel -> "New" -> "Server").
- Choose "Apache/Tomcat v6.0"
- If this is the first server you add, you will have to specify the installation path of an existing Tomcat installation. I would suggest to go with the offered "Download and Install..." of 6.0.14, since the latest version has slight compatibility issues. As a side benefit, it's a non-install, stand-alone version, which is only executed as needed.
- Next, right-click the newly created server and choose "Open".
- Select "Serve modules without publishing".
- Switch to the "Modules" screen (tab at the bottom of the window).
- Click "Add External Web Module...".
- Enter your JForum source location as the Document Base. Additionally, I use "/JForum" for the Path.
- Hit "OK" and save the Tomcat Configuration.
- Done!
This way, the Tomcat configuration is handled directly by Eclipse on a per-project basis and does not affect your global Tomcat setup. This makes working with Tomcat when switching projects and workspaces more straightforward, especially if you're dealing with multiple branches.
Now, you're done. You can start the server directly from the Servers panel in various modes. If you run it in debug with breakpoints set, you may be asked to add your source path for the debugger to work.
Enjoy!
[originally posted on jforum.net by drematic]