I am wondering what the popular or best way to organise your build assets and source code within a project is?
One folder structure best practice is to avoid having folders that compete with one another. Try not to create folders with overlapping categories. Instead, create folders which are distinct from one another, and use nesting to arrange them as needed.
Tree-structured directory – A tree structure is the most common directory structure.
I have
/src - source files (test files are within a package 'test' here, or 'test' subpackage of what is being tested) /lib - required libraries /doc - text documentation and development notes /build - where we build (each separate build item within a subfolder here) /conf - configurations (each config, production, test, developer, etc gets a folder in here, and when building Jars and Wars the correct set is copied across) /extras - other stuff /extras/resources - resources that should be included within generated Jars, e.g., icons
with
/websites - Web related content and configurations (each website in its own folder here) /websites/$site/webcontent - All the web content here /websites/$site/conf - website related configuration files here (instead of /conf) /websites/$site/build.xml - ANT build script for website that creates a war, etc (remember you might have an admin site and a public site for a single project, hence the multi-site configuration within a single project, or even site v1 and site v2, etc)
In the end you have to be a bit flexible depending on the project itself, and whether you use ANT or Maven. I use ANT, and either put the ANT scripts in /build, but they have appeared elsewhere in some projects (like in /websites/ for some).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With