Dear Maven,
Is it possible to specify custom source/output directories for compiling
outside of the default compile/test phases and associated default directory
locations?
I want to store my integration tests in the below folder structure analogous to
the Maven project structure for main and test code:
src/integrationtest/java
I would then like to be able to compile the integration test sources during the
pre-integration-test phase to:
target/integrationtest-classes
I'd like to be able to run a regular build using mvn install which after
compiling my main code, compiling my test code and running unit tests as per
the default behaviour, then goes on to compile the integration tests and run
them during the pre-integration-test an integration-test phases respectively,
but the plugin appears not to support this.
I was hoping to be able to configure the plugin something like the following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-integration-tests</id>
<phase>pre-integration-test</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compileSourceRoots>
<compileSourceRoot>${integrationTestSourceDirectory}/java</compileSourceRoot>
</compileSourceRoots>
<outputDirectory>${integrationTestOutputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Does the plugin support this kind of configuration? If not, are there any
plans to include this feature in the plugin at all, e.g. as a customCompile
goal perhaps?
Kind regards,
Matt