Andreas Dolk
Andreas Dolk

Reputation: 114817

maven command line - plugin configuration

I'm in the need to run integration tests one by one with the failsafe plugin (please, don't ask why... They just have to run in individual jvms, one good reason for avoiding singletons).

So I'd like to create a script with one maven call per line where each maven call runs tests on a single test file. Something like this:

mvn failsafe:integration-test -D<???>=**/ITest1.java
mvn failsafe:integration-test -D<???>=**/ITest2.java
mvn failsafe:integration-test -D<???>=**/ITest3.java
...

In a pom.xml I'd add something like

<includes>
  <include>**/ITest1.java</include>
</includes>

to the plugins configuration. Is there a way to achieve the same with the command line? Is it possible to specify list-like configuration options?

Upvotes: 1

Views: 930

Answers (2)

Augusto
Augusto

Reputation: 29997

The it.test parameter does that. You can read about it here.

From the docs:

[...] so you can just type "-Dit.test=MyTest" to run a single test called "foo/MyTest.java".

Upvotes: 2

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 299178

The syntax is:

mvn -Dit.test=TestName verify

Source: Failsafe Plugin Examples: Running a Single Test

Upvotes: 4

Related Questions