billc.cn
billc.cn

Reputation: 7317

Are Maven surefire and failsafe versions always going to be the same

I have both JUnit and testng on my classpath and is using the "provider" dependencies trick from Mixing TestNG and JUnit tests in one Maven module – 2013 edition to choose which one is going to be used.

However, the dependencies are only available for surefire so if I use them on failsafe, the version number will still follow surefire's.

It seems the two test plugins are actually the same project (and same code?) just named differently and they currently have the same version number. Is this likely to be the case in the long run?

Upvotes: 2

Views: 774

Answers (1)

khmarbaise
khmarbaise

Reputation: 97487

The maven-surefire-plugin is intended for unit tests which is bound by default to the test life cycle phase where as the maven-failsafe-plugin is intended for integration tests which is not bound by default to any life cycle phase.

So they have many code in common cause there are only slight differences but they are not simply named different by accident they are named different on purpose. Yes the version number of maven-surefire/maven-failsafe are in synch, cause they are released together. And yes they will be kept separately cause they have different intentions.

If you don't mix junit and testng within a single module you can omit the provider trick by just using the dependencies on junit or testng in the appropriate module...Than maven-surefire-plugin will use the appropriate provider automatically.

Upvotes: 2

Related Questions