directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Testing issue, need pointers
Date Sat, 29 Sep 2007 23:34:21 GMT

On Sep 29, 2007, at 3:12 PM, Enrique Rodriguez wrote:

> Hi, Directory developers,
> I'm looking for pointers for an issue I recall coming up before,
> namely that reusable test classes that are in "src/test/java" don't
> get packaged into artifact jars, so they can't be reused by other
> Maven2 modules.  When I asked before someone (David?) had a best
> practice here and I don't recall enough to find the answer or thread.
> There are base classes in server-unit and in local work I have for
> Kerberos that are only used by tests but that would be nice to reuse.
> Of course, the simple solution is to move these classes to
> "src/main/java," but that was shutdown before in favor of this other
> solution I'm alluding to.

So what you need to do is to get maven to package up jars with the  
"tests" classifier for these modules, containing the tests.  Then  
other subprojects can depend on the test jars.

If you configure the jar plugin to do this for everything in the  
project it would be in pluginManagement like:

                                 <!-- Build *test.jar files for  
modules -->

this might be overkill for the whole project, but I think you can  
just include something like this without the version in the  
<build><plugins> section of an individual subproject.

To use one of these test jars your dependency would look something like


david jencks

> TIA,
> Enrique

View raw message