Skip to content

Conversation

@rsvoboda
Copy link
Contributor

@rsvoboda rsvoboda commented Nov 27, 2025

Enhance opennlp.tools.util.Version to parse suffixed version without error.

Without this change, versions like 1.5.4.foobar-007 end with java.lang.NumberFormatException: For input string: "4.foobar" when parsed by opennlp.tools.util.Version

Quarkus LangChain4J uses opennlp library transitively. We faced the above exception during startup when the dependency got productized - RedHat (part of IBM) rebuilds dependencies from the sources and adds a suffix to avoid GAV collision with the upstream project.

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions for build issues and submit an update to your PR as soon as possible.

Signed-off-by: Rostislav Svoboda <rosta.svo@gmail.com>
@rsvoboda
Copy link
Contributor Author

For this to appear also in opennlp-2.x branch, do I just create PR targeting that branch or there is a backports procedure to follow?

@rzo1
Copy link
Contributor

rzo1 commented Nov 27, 2025

For this to appear also in opennlp-2.x branch, do I just create PR targeting that branch or there is a backports procedure to follow?

Yes. You can create another PR targeting 2.x

@mawiesne mawiesne changed the title Enhance opennlp.tools.util.Version to parse suffixed version OPENNLP-1788: Enhance opennlp.tools.util.Version to parse suffixed version Nov 28, 2025
Copy link
Contributor

@mawiesne mawiesne left a comment

Choose a reason for hiding this comment

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

Thx @rsvoboda for the contribution, much appreciated.

@rsvoboda
Copy link
Contributor Author

Yes. You can create another PR targeting 2.x

Done - #900

@jzonthemtn
Copy link
Contributor

Thanks @rsvoboda!

@rzo1 rzo1 merged commit c40f1c8 into apache:main Nov 29, 2025
12 checks passed
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.

5 participants