You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by simon <sk...@apache.org> on 2008/02/17 19:36:14 UTC

maven-compiler-plugin: setting testSourceDirectory for an execution

Hi,

I want to create multiple executions of the maven-compiler-plugin that
use different testSourceDirectory and testOutputDirectory settings.

The reason is that the particular project I'm trying to maven-enable
(clirr) is designed to analyse jarfiles. So as part of its unit tests,
it first builds a couple of jarfiles from local sources, then runs its
unit tests against them.

Ideally, I want the test-compile phase to run the compile:testCompile
goal three times: once to build the source for testjar1, once to build
the source for testjar2, then once to build the real unit-test code.
After that, the "test" phase can happily run and find the jars it needs
to run tests against.

But I cannot see any option on the maven-compiler-plugin to specify an
override for the <testSourceDirectory> or <testOutputDirectory>
settings. Is there one, or not?

An alternative is to make the two test jars into subprojects. But that
means moving the code around (in CVS, ecch), and then fixing the
existing ant and maven1 builds. Not so tempting.

Regards,
Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven-compiler-plugin: setting testSourceDirectory for an execution

Posted by VUB Stefan Seidel <ss...@vub.de>.
Hi,

I think it should be possible to use the <includes>/<excludes> and 
<outputFileName> configuration elements for the plugin in conjunction 
with multiple executions during an appropriate phase, e.g. 
generate-test-resources for your purpose.

regards,

Stefan

simon wrote:
> Hi,
> 
> I want to create multiple executions of the maven-compiler-plugin that
> use different testSourceDirectory and testOutputDirectory settings.
> 
> The reason is that the particular project I'm trying to maven-enable
> (clirr) is designed to analyse jarfiles. So as part of its unit tests,
> it first builds a couple of jarfiles from local sources, then runs its
> unit tests against them.
> 
> Ideally, I want the test-compile phase to run the compile:testCompile
> goal three times: once to build the source for testjar1, once to build
> the source for testjar2, then once to build the real unit-test code.
> After that, the "test" phase can happily run and find the jars it needs
> to run tests against.
> 
> But I cannot see any option on the maven-compiler-plugin to specify an
> override for the <testSourceDirectory> or <testOutputDirectory>
> settings. Is there one, or not?
> 
> An alternative is to make the two test jars into subprojects. But that
> means moving the code around (in CVS, ecch), and then fixing the
> existing ant and maven1 builds. Not so tempting.
> 
> Regards,
> Simon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org