Java – project setup using eclipse and mercurial
I'd like to make some suggestions on using eclipse to set up multi - Project workspaces In other words, I'm going to create some applications that will use two or more projects for final build The project will be stored in a version control system This is easy to do
The advice I'm looking for is how to set up version control or eclipse workspace to make setting up a new developer / new machine * very easy Ideally, a new developer or developer on a new machine only needs to issue a command (possibly eclipse, version control system, some build systems, or even scripts); This command creates an environment in which code can be built
I will use Java as the language and mercurial for version control, if this is important to the solution I am willing to use build systems, even though I am not familiar with any of them
Basically, I want to learn
>Where projects should be stored in the repository > how eclipse should import or otherwise discover projects > how to start the above discovery
*In this case, the new machine means a machine with the necessary applications (such as eclipse and tortoisehg) but without checking the code or any workspace
Solution
Each eclipse installation requires the installation of the mercurial Eclipse Plug-in, which can be installed through "install new software..." by pointing to the following URL: http://cbes.javaforge.com/update
These are the steps I usually use when setting up a new application:
>Set up my project in eclipse > go to the command line, create a Hg repository, and then move my project to the folder containing the repository. > Delete the bin directory (so mercurial will not be checked in) > issue 'Hg add' under the root directory of the mercurial repository. > Delete the project in eclipse (do not click the "delete project content on disk" check box, otherwise an error will occur) > select import from the file menu Under the general folder, select 'existing projects into workspace'. > Select the Browse... Button next to select root, and then select your mercurial repository root folder. > In the Import dialog box, click Select all, and then click finish. > Open the navigator view (so you can see the bin folder), right-click the bin directory in a project, and go to "team" and "ignore..." Select this folder only ('bin '), then click OK. > select all projects, right-click, select team and select submit
At this point, your workspace is fully connected to the local mercurial repository and all folder structures are set up correctly
When you are ready to share this content with others, you push the repository to a shared location In another eclipse environment (possibly on another computer), go to the window menu and select Show view and other In the mercurial folder, select mercurial repositories and click OK In the mercurial repositories view that just appears, click the "create Repository..." button It looks like a team repository with Hg and plus signs If necessary, enter your shared repository URL and any authentication information Right click the repository you just created and click clone repository That's right. All eclipse settings are extracted from mercurial, and everything is set for the second developer
It may sound like a lot of steps, but I can do it in less than two minutes because I've practiced it several times