I'm implementing a maven build on a medium-sized code base. The production dependency tree looks something like the following:
n -> ... -> C -> B -> A C->B But there's a problem class PC in test "branch" of B, that "downstream" tests (n -> ... -> C) depend upon. It's a dependency quagmire, with a ton of static methods that new up test instances of all varieties. Most of these Foos and Bars are defined in B. So, I've chosen to draw a line in the sand and put PC into a new testing utility project test-B-utils. But, not surprisingly, many tests in B use PC as well. Options I can think of: 1. Move PC to src/main (kind of like the legacy build) and exclude PC from the production build (ignore the dependency problems). 2. Stick an interface for PC upstream (test-A-utils) and return extracted interfaces for all Foos and Bars. Use dependency inversion to build up PCIfaces in B and test-B-utils. Deal with some overlapping functionality in PCforB and PCforEveryoneElse (test scoped). Does anyone have a simpler or better mechanism? JPN
