Skip to content

Remove compilation error resolution proposal for adding Junit 5 bundles#2104

Merged
HannesWell merged 1 commit intoeclipse-pde:masterfrom
HannesWell:remove-junit5-dependency-proposal
Nov 6, 2025
Merged

Remove compilation error resolution proposal for adding Junit 5 bundles#2104
HannesWell merged 1 commit intoeclipse-pde:masterfrom
HannesWell:remove-junit5-dependency-proposal

Conversation

@HannesWell
Copy link
Member

For junit-5 it's sufficient and recommended to just import the packages needed for compilation. Alternatively it's also possible to require the junit-jupiter-api bundle.

Both is already proposed by default and in both cases it's not necessary to require the junit-4 bundle (org.junit) too.

As this extra proposal also complicates the code significantly, it is removed with the recommendation to use the other standard proposals in case of missing JUnit-5 dependencies too.

Furthermore the current code seems to be partially incorrect, because actually package names have to be checked while it seems that the code assumed bundle names (which only coincidentally match).

Removing it also avoids the need to handle the JUnit-6 case too.

This was initially proposed in

With this, the proposals are now (#2053 (comment) contains the previous state):

In a follow-up PR the proposals should be further enhanced to

  • show package-imports at the top
  • remove duplicated proposals
  • show versions and propose multiple versions if available.

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

Test Results

   771 files  +  257     771 suites  +257   53m 22s ⏱️ + 17m 5s
 3 634 tests ±    0   3 580 ✅ ±    0   54 💤 ± 0  0 ❌ ±0 
10 836 runs  +3 612  10 673 ✅ +3 558  163 💤 +54  0 ❌ ±0 

Results for commit c788f66. ± Comparison against base commit 8d8b12d.

♻️ This comment has been updated with latest results.

@laeubi
Copy link
Contributor

laeubi commented Nov 6, 2025

This sounds reasonable to me also moving package imports to the top would be great.

@trancexpress
Copy link
Contributor

Thinking about this, maybe this was done before it was enough to add junit-jupiter-api to the dependencies. So at that time likely it made sense to have an extra fix proposal.

For junit-5 it's sufficient and recommended to just import the packages
needed for compilation. Alternatively it's also possible to require the
junit-jupiter-api bundle.

Both is already proposed by default and in both cases it's not necessary
to require the junit-4 bundle (org.junit) too.

Furthermore the current code seems to be partially incorrect, because
actually package names have to be checked while it seems that the code
assumed bundle names (which only coincidentally match).

As this extra proposal also complicates the code significantly, it is
removed with the recommendation to use the other standard proposals in
case of missing JUnit-5 dependencies too.

Removing it also avoids the need to handle the JUnit-6 case too.
@HannesWell HannesWell force-pushed the remove-junit5-dependency-proposal branch from bb0a851 to c788f66 Compare November 6, 2025 20:27
@HannesWell
Copy link
Member Author

Thinking about this, maybe this was done before it was enough to add junit-jupiter-api to the dependencies. So at that time likely it made sense to have an extra fix proposal.

Yes that's likely the case. It was done quite some time ago and in the meantime a lot was improved in the area of launching Eclipse apps with respect to adding dependencies automatically, not only for tests (and through the OSGi metadata of junit itself) but also generally.

But I'm glad we can now remove this.

@HannesWell HannesWell merged commit 8de0b27 into eclipse-pde:master Nov 6, 2025
16 of 19 checks passed
@HannesWell HannesWell deleted the remove-junit5-dependency-proposal branch November 6, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants