Skip to content

Conversation

@laeubi
Copy link
Contributor

@laeubi laeubi commented Oct 25, 2025

With the recent adoption of JUnit 6 we noticed that JUnit no longer can run on stripped down JVMs that are missing the flight recorder module because it has a mandatory import in the OSGi manifest.

As the flightrecorder integration seems optional, one might want to make the import of the package optional as well


I hereby agree to the terms of the JUnit Contributor License Agreement.


The content was generated by copilote here I squashed the commits, reviewed the result and found it being sane compared to how it was done for other optional imports. Please let me know if any adjustments are necessary as I'm not familiar with gradle.


Definition of Done

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think it's good to make this consistent with the module descriptor. Please note that we might make it mandatory in the future at which point the JDK used needs to include the jdk.jfr module or add jfr-polyfill to their classpath.

Import-Package: \
${importAPIGuardian},\
${importJSpecify},\
${importJdkJfr},\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these changes to the build script of junit-platform-launcher as they're specific to that module/bundle (see junit-platform-commons for an example).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcphilipp I'm sadly not very familiar with gradle build scripts and looking at that build-script I'm not completely sure how to archive this, as that one adds an additional header and here we want to modify an existing definition. I could repeat the definition there but it seems a bit odd to maintain then.

Any suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! I pushed a few commits. I agree that modifying an existing definition is not as DRY as one would wish.

@marcphilipp marcphilipp merged commit 729fc28 into junit-team:main Oct 26, 2025
17 checks passed
marcphilipp added a commit that referenced this pull request Oct 30, 2025
For consistency with its module descriptor.

---------

Co-authored-by: Marc Philipp <[email protected]>
(cherry picked from commit 729fc28)
@marcphilipp
Copy link
Member

Cherry-picked to releases/6.0.x in fedda88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants