I've noticed that a lot of projects have the following structure:
I currently use the following convention (as my projects are 100% java):
I'm not currently using Maven but am wondering if this is a Maven convention or not or if there is another reason. Can someone explain why the first version is so popular these days and if I should adopt this new convention or not?
Chris
Main benefit is in having the test
directory as subdirectory of src
with the same directory structure as the one in main
:
All package private methods of RootLevelPackageClass
will be visible, i.e. testable from TestRootLevelPackageClass
. Since the testing code is also source its place should be under src
directory.