On Tue, Jun 16, 2009 at 11:01 AM, David C. Hicks<[email protected]> wrote: > Hi gang, > > I've been trying to find a reasonable solution to a problem we have with > our Maven-based project. We have a collection of Builder classes that > can create Model objects for testing purposes. These are segregated > into a separate module (TestSupport) which has the Model artifact as a > dependency. This works great for almost everything. The catch is that > the more complex Model classes have unit tests that rely on these > builders to make the test code easier to read and maintain. So, in that > case the Model artifact would need to have the TestSupport artifact as a > dependency. Obviously, this isn't going to fly. For the time being,
The main code depending on test code is bad design. Pull out the pieces of the code from the test directories and promote it to main code. You should be able to untangle just enough for the main code to no longer depend on test. > the more complicated unit tests are being held in the TestSupport > module, but this really isn't where they belong. We need to keep the > Builders in an artifact of their own because they are used by other > modules for unit and functional tests. [del] > On the other hand, maybe there's a better way to get my Maven build set > up that will solve this problem for me. Either pull out the pieces and place into src/main/java as suggested above, or create another module that can contain the helper/build methods and have your main code depend on the helper artifacts. Using another module will mean that those helper classes are already built and available for your use. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
