I came to a really simple solution. My project has the following structure:
it/noaop/pom.xml
it/noaop/src/test/java
it/withaop/pom.xml
it/withaop/src/test/java
src/main/java
pom.xml
In the root pom.xml I placed these plugins:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>it/noaop/target</directory>
</fileset>
<fileset>
<directory>it/withaop/target</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<projectsDirectory>it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<showErrors>true</showErrors>
<streamLogs>true</streamLogs>
<goals>
<goal>test</goal>
</goals>
<pomIncludes>
<pomInclude>**/pom.xml</pomInclude>
</pomIncludes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Then when i run mvn integration-test, Maven executes the unit tests, packages, and then execute all the integration test projects with the newly installed dependency.

Simply good, thanks for sharing information and putting up a good step by step tutorial man.
ReplyDelete