Skip to content

7904169: JMH: Specify annotation processor configuration in samples#165

Closed
FBibonne wants to merge 5 commits intoopenjdk:masterfrom
FBibonne:fix-annotation-processor-for-samples
Closed

7904169: JMH: Specify annotation processor configuration in samples#165
FBibonne wants to merge 5 commits intoopenjdk:masterfrom
FBibonne:fix-annotation-processor-for-samples

Conversation

@FBibonne
Copy link
Copy Markdown
Contributor

@FBibonne FBibonne commented Dec 23, 2025

When building with maven jmh-samples with a jdk version 22+ , the annotation processor jmh-generator-annprocess is not executed and files and classes generated by jmh are not included in the jar. Then there is an error at runtime when trying to execute samples with command line such as java -jar target/benchmarks.jar JMHSample_01 : Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList

This error happens because the jmh-sample pom.xml does not explicitly set jmh-generator-annprocess as an annotation processor path. This PR aims to correct this issue like the PR #125


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • CODETOOLS-7904169: JMH: Specify annotation processor configuration in samples (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmh.git pull/165/head:pull/165
$ git checkout pull/165

Update a local copy of the PR:
$ git checkout pull/165
$ git pull https://git.openjdk.org/jmh.git pull/165/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 165

View PR using the GUI difftool:
$ git pr show -t 165

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jmh/pull/165.diff

Using Webrev

Link to Webrev Comment

- specify explicitly jmh-generator-annprocess dependency in <annotationProcessorPaths>

Signed-off-by: Fabrice Bibonne <fabrice.bibonne@courriel.eco>
@bridgekeeper bridgekeeper Bot added the oca Needs verification of OCA signatory status label Dec 23, 2025
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Dec 23, 2025

Hi @FBibonne, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user FBibonne" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Dec 23, 2025

@FBibonne This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

7904169: JMH: Specify annotation processor configuration in samples

Reviewed-by: shade

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@FBibonne
Copy link
Copy Markdown
Contributor Author

/signed

@bridgekeeper bridgekeeper Bot added the oca-verify Needs verification of OCA signatory status label Jan 17, 2026
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Jan 17, 2026

Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@bridgekeeper bridgekeeper Bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Feb 1, 2026
@openjdk openjdk Bot added the rfr Pull request is ready for review label Feb 1, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Feb 1, 2026

Webrevs

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Feb 14, 2026

@FBibonne This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@FBibonne
Copy link
Copy Markdown
Contributor Author

/touch
My OCA has been processed so you can review this PR. 🙏

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Feb 18, 2026

@FBibonne The pull request is being re-evaluated and the inactivity timeout has been reset.

@galderz
Copy link
Copy Markdown
Contributor

galderz commented Mar 13, 2026

PR #125 is already integrated into master, why is there a need for this PR?

I see now, you're doing this for jmh-samples. However, shouldn't the change follow same pattern as in PR #125? That is, keep the dependency as in and just add this to the compiler plugin?

<annotationProcessors>
    <annotationProcessor>org.openjdk.jmh.generators.BenchmarkProcessor</annotationProcessor>
</annotationProcessors>

@FBibonne
Copy link
Copy Markdown
Contributor Author

OK. I agree with the pattern <annotationProcessor>org.openjdk.jmh.generators.BenchmarkProcessor</annotationProcessor> : my last commit made this change to the pom .

Copy link
Copy Markdown
Contributor

@galderz galderz left a comment

Choose a reason for hiding this comment

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

Thanks for changing that @FBibonne. I would however keep the dependency in place. The archetype does indeed do that too https://github.com/openjdk/jmh/blob/master/jmh-archetypes/jmh-java-benchmark-archetype/src/main/resources/archetype-resources/pom.xml#L54

Copy link
Copy Markdown
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Please go to https://github.com/FBibonne/jmh/actions and enable the testing workflows. I agree with @galderz that dependency on jmh-generator-annprocess should stay.

@shipilev shipilev changed the title Specify explicitly jmh-generator-annprocess as an annotation processor in jmh-samples pom.xml 7904169: JMH: Specify annotation processor configuration in samples Mar 19, 2026
@shipilev
Copy link
Copy Markdown
Member

Merged GHA fix -- 5b34c95 -- please merge from master to get clean test run.

Copy link
Copy Markdown
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Looks fine, thanks. Feel free to /integrate once GHA turns out green.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Mar 21, 2026
@FBibonne
Copy link
Copy Markdown
Contributor Author

Thank you very much @galderz and @shipilev for your review and your advises : integration tests were failing on my laptop. Obviously you gave me the solution with the github workflow.

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Mar 21, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 21, 2026

@FBibonne
Your change (at version 2ddc3f1) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Copy Markdown
Member

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 23, 2026

Going to push as commit d95d9e0.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Mar 23, 2026
@openjdk openjdk Bot closed this Mar 23, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Mar 23, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 23, 2026

@shipilev @FBibonne Pushed as commit d95d9e0.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@FBibonne FBibonne deleted the fix-annotation-processor-for-samples branch March 26, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants