I have a Java project that will be worked on as multiple eclipse projects: one client, one server, and a common area containing the classes, etc. that will be shared between them. I have it envisioned as one repository containing 3 (or 4) eclipse projects.
Of course I could make it 3 repositories, but these will be so closely linked I think that would cause more problems than it’s worth, and they’re not going to be large enough to worry about someone wanting only a subset of the files.
My thought was to create a repository folder, call it parent, and then create a folder under that for each eclipse project, call them childA, childB, and childC. When I (or anyone) clones the repository, clone it to a folder outside the eclipse workspace. Then, in eclipse, create each project by importing the corresponding folder – assuming it’s a maven project, for instance, in eclipse do “File / Import” and choose “Maven / Existing Maven Project”, then choose (for example) childA. I’m assuming this will create an eclipse project based on the ChildA source, but leave that source in the folder to which it was cloned. It can then be managed with eGit and edited, compiled, run, debugged, etc. I would do the same with childB and childC, giving me 3 separate eclipse projects from that one repository.
Within eclipse, I could specify the common library project as one available on the build path of both the client and server, and be off and running. At runtime, I could either create a jar for the common library or just put the common class files, etc. in both the server jar and the client jar.
Is this a good way to do this? An ok way? A best practice way? I am still learning Git, and so am open to suggestions.