On 09.12.23 23:28, Damiano Albani wrote:
Hello,

I'm a long-time Maven user but I've just recently discovered that, unless
I'm mistaken, the Failsafe plugin isn't part of the default set of plugins
which are configured "out of the box".
Is this correct?

If so, I find this quite strange given that Failsafe is mentioned on
https://maven.apache.org/plugins/index.html as a "core plugin", just like
its sibling Surefire, the latter being indeed included.

In order to change that, would it simply be a matter of adding Failsafe to
https://github.com/apache/maven/blob/maven-3.9.6/maven-core/src/main/resources/META-INF/plexus/default-bindings.xml
?
Or are there locations in the Maven codebase that would need to be changed?

First your assumption is correct it's not part of the default life
cycle[1] which means it is not bound by default.  If you like to use it
you have to make the binding yourself.

Maven Failsafe Plugin is intended for running integration tests based on
the naming schema "*IT.java" (etc.)

So why isn't it added by default?

The answer is more or less simple. Because it's not always needed nor used.

I can give you some statistical information based on the downloads via
central.

The maven-surefire-plugin (over all versions) is downloaded ca. 30
million times a month. The maven-failsafe-plugin (over all versions) is
downloaded ca. 5 million times a month[2].

In other words the majority of the cases people running unit tests but
not integration tests... (ca. 1/6)..

Another question would arise if you like to make it part of the default
life cycle:

Should both goals "integration-test" bound to the lifecycle as well as
"verify" or just one of them?

Another thing is very often people create a profile to activate the
integration tests whenever they like based on the time consumption of
integration tests. That's simply because integration tests are running a
way longer than unit test. Something like "mvn verify -Prun-its" (which
by the way the maven teams does as well for all the plugins).

Another question arises: Is this enough because running integration test
could require other things? For example starting a thing like
tomcat/jetty etc. or docker containers and even many other things? Or
would it be better to control that via the integration test itself (via
testcontainers or alike) etc.


Kind regards
Karl Heinz Marbaise
Apache Maven PMC

[1]: https://maven.apache.org/ref/3.9.6/maven-core/default-bindings.html
[2]:
https://blog.soebes.io/posts/2023/08/2023-08-06-download-statistics-for-maven/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to