maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <>
Subject Re: Need advice automating a Java test suite.
Date Wed, 08 Jan 2014 22:38:19 GMT
Profiles are the path to madness.

There are two ways I can see to tackle this:

1. Use the invoker plugin to fork maven builds for each of your test steps


2. Use a multi-module project so that the separate modules do the separate

The second is likely the more "maven way" but the 1st is not too far off,
if done right, and probably the easiest to implement... Not too hard to
refactor to #2 if you decide to later

On Wednesday, 8 January 2014, Todd Chapman wrote:

> Hello,
> We have a java multi-module project that has a somewhat painful to run test
> suite that I would like to get under control using Maven.
> Currently it takes 5 separate Maven commands to setup, run, and teardown
> all the tests and test databases. I'd like to get this down to one command.
> Also I would like this structured so that individual parts of the process
> can be run separately to aid in debugging problems.
> The pom has 1 profile for each part of the task, all bound to the "test"
> goal:
> mvn clean test -P test-setup-1,local-enterprise-test-db  (exec:java plugin
> to setup up a database)
> mvn test -P test-setup-2,local-enterprise-test-db           (exec:java
> plugin to setup up a 2nd database)
> mvn test -P test-design,local-enterprise-test-db            (surefire
> plugin to run a subset of the tests with maven properties set)
> mvn test -P test-transactional,local-enterprise-test-db   (surefire plugin
> to run a different subset of the tests with different maven properties set)
> mvn test -P test-tear-down,local-enterprise-test-db        (exec:java
> plugin to teardown the databases)
> The problem I am running into is how to get this organized so that it all
> happens with 1 command. It seems nearly unpossible.
> Can anyone offer any advice on how to accomplish this? Pointer to relevant
> articles, blog posts, stackoverflow questions would be most appreciated.
> Thanks!
> -Todd

Sent from my phone

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message