Customising directory structures in Eclipse
In my why have all your eggs in one basket? blog post, I described how you could completely customise the structure of your Eclipse projects to be almost any thing you wanted. Perhaps though, I may have been a little misleading, and could have implied that I think that this kind of frigging around is a good thing.
What I believe is fundamental is ensuring that your artefacts are stored in a way that makes it very clear how they are created and how they are used. For example, your source files should be held in a completely different area to the compiled class files, and your test cases should be held separate to the main source files.
The article describes how you could take this a whole stage further, but should you?
I think the Eclipse web tools do a pretty good job of putting the artefacts in sensible places, mimicing the standard structures you’d expect of a Java web app. Furthermore, it’s trivial to take this structure as-is, and using your build tool of choice, build the application outside of the IDE.
For me, the fact that Eclipse’s structure is well understood, easy to build externally to the IDE (i.e. as part of my CI build mechanism) is good enough for me and I virtually always leave it at that.
If, and only if that isn’t enough should you consider doing anything else to mess around with the structure. For example, you may be splitting development of a couple of key areas of a web application into two smaller teams and want to ensure there’s no overlap on the resources; you may have a pre-mandated directory structure that fits in with the standards laid down by your IT department to ensure that the build processes run smoothly; it could just be that you’re a little nutty.
The point is don’t over complicate for the sake of it; the flexibility is there if you need it. If you don’t need it, KISS!