Hello Tibor
Even if Maven wanted to be independent of JUnit 5, Maven does not need
to invent its own test API. JUnit5 has a separation between API and
implementations, so it would be possible to use only the API part if
necessary (I don't think that it would be necessary, just mentioning
that we have this possibility). Therefore, a full switch to JUnit 5
would not necessarily make us fully prisoner of JUnit 5.
Keeping direct support of JUnit 3 (as opposed to indirect support
through JUnit 5 API) has a cost. For example, I saw requests on this
mailing list for testing the different versions of a multi-release JAR
file. Currently, any classes in META-INF/versions/* will be ignored at
testing time, because Surefire runs the tests with the `*.class` files
on the class-path while multi-release works only with JAR files. Last
Saturday, I wanted to start looking for the possibility of adding an
option for running the tests many times with different
`META-INF/versions/*` directories added to the class-path. It was not
easy to find my way in the Surefire code, and I rely a lot on the
simplification proposed by Romain before to make any other attempt.
Of course there is a risk that we break something. But the example given
in the previous email (tests as POJO) should be easy to port. The
alternative (not removing direct JUnit 3 support) is more like freezing
the Surefire plugin: no accidental lost of feature, but also less new
features (e.g. easier testing of multi-release projects) because they
would be more difficult to implement.
Martin
Le 07/10/2025 à 19:16, Tibor Digana a écrit :
Romain,
to be honest the JUnit guys always wanted to make their own business and
monopoly over the testing phase in Maven, which means using JUnit5 only,
that's it.
I have been a JUnit4 developer since cca 2011 or so, and we know each other.
If I say business then I really mean business and not only the word.
Defining report schema and forking mechanism JVMs in JUnit5, these are
still the same competition problems between us, and I say it's about the
monopoly, which means who takes the control over these things takes full
control over Maven testing and then Maven becomes completely dependent on
some test framework which is the risk for Maven.
This is the main problem but you wouldn't see this unless you have spent
years and years developing both parties as I have.
Making Maven strictly dependent only on JUnit5 is the worst decision
ever, I am telling you!
Btw, experienced Maven guys must know what a strict dependency means and
the consequences too.
We are still in the loop for years with deleting something because somebody
has got a crazy idea in the morning, found out github/dev-factory or
anything else, some tool or technology as many other, those tools which
come and go every year.
On Mon, Sep 29, 2025 at 9:09 AM Romain Manni-Bucau <[email protected]>
wrote:
Hi all,
I'd like to start a thread about potentially dropping surefire totally.
The rational is that surefire (and failsafe) are mainly an abstraction
layer on top of main test providers.
However, since JUnit5 the platform/engine is itself such an abstraction
layer and a runner.
On another side, testng and junit4 are slowly getting abandonned - even EE
TCK started to move.
In terms of additional features we do have the maven site integratoin - but
I doubt it is much used outside and to be honest it can be replaced with a
github/dev-factory link with more benefit these days.
So overall I think we can converge by dropping surefire plugin in favor of
a thin wrapper of junit5 console runner ([1]).
Short terms I'm sure Christian could help us getting something fast based
on its implementation ([2] - including a small surefire compatibility mode)
and long term it will reduce the maintenance cost we do have for a very
poor gain in current world (site and remoting are no more key features
thanks the CI and doc evolution).
Wdyt? Is maven 4 the mometum to do it?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]