[ 
https://issues.apache.org/jira/browse/SLING-12131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784213#comment-17784213
 ] 

Julian Sedding commented on SLING-12131:
----------------------------------------

bq. I've used this before and it works well, [...]

Glad to hear that!

bq. Well, complete conversion to JUnit5 Jupiter should not be required before 
the JUnit4 can be removed. Conversion to JUnit5 Vintage Engine should handle 
custom @Rules and whatever other JUnit4 constructs are being used. That's all I 
am talking about. Once that is done, the dependency on the unmaintained JUnit4 
is removed. Conversion from Vintage to Jupiter can take as long as it takes.

JUnit4 is not removed as long as you have the JUnit5 Vintage Engine. JUnit4 is 
then just a transitive dependency and not explicitly in your pom. As long as 
you are using @Rules, which are a JUnit4 API, you cannot remove the JUnit4 
dependency. There is also {{junit-jupiter-migrationsupport}}, which can emulate 
some JUnit4 rules. But again, that one does not remove the dependency on the 
@Rule API provided by the JUnit4 dependency.

So I think we're finding common ground :) I'm conceding that migrating is 
desirable, and you seem to be conceding that it's a best-effort exercise and 
some parts of such a migration can be non-trivial.

> Update sling-parent pom.xml to include JUnit5 dependencies
> ----------------------------------------------------------
>
>                 Key: SLING-12131
>                 URL: https://issues.apache.org/jira/browse/SLING-12131
>             Project: Sling
>          Issue Type: Task
>            Reporter: Rob McDougall
>            Priority: Major
>
> JUnit4 is in maintenance mode (no updates in the last 2 years and then only 
> security fixes).  I think updating projects to JUnit5 should be encouraged.
> I am thinking this should be a relatively easy change of adding the 
> junit-jupiter and junit-vintage-engine into the Dependency Management section 
> of the sling-parent.
> Once this is done, individual projects could switch to the vintage-engine (at 
> the very least) or move to jupiter by switching the dependency in their 
> project pom.
> Some day down the road, the JUnit 4 dependencies could be removed.  Projects 
> that have not updated to JUnit5 (vintage or jupiter) by that time are likely 
> no longer maintained.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to