Skip to content

Fixes issue #11827 - Maven DI crashes if the file org.apache.maven.api.di.Inject contains empty lines#11828

Merged
slawekjaranowski merged 3 commits intoapache:masterfrom
jafarre-bi:bugfix/#11827
Mar 23, 2026
Merged

Fixes issue #11827 - Maven DI crashes if the file org.apache.maven.api.di.Inject contains empty lines#11828
slawekjaranowski merged 3 commits intoapache:masterfrom
jafarre-bi:bugfix/#11827

Conversation

@jafarre-bi
Copy link
Contributor

@jafarre-bi jafarre-bi commented Mar 23, 2026

Adds a check to ignore blank lines when reading org.apache.maven.api.di.Inject.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Copy link
Member

@cstamas cstamas left a comment

Choose a reason for hiding this comment

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

Note: maybe just !isBlank()?

@jafarre-bi
Copy link
Contributor Author

Not sure whether it had to be compatible with Java < 11

@cstamas
Copy link
Member

cstamas commented Mar 23, 2026

Maven 4 (master and maven-4.0.x) is Java 17+

Also, you need to build locally (or apply spotless explicitly mvn spotless:apply) to reformat before pushing.

@jafarre-bi jafarre-bi marked this pull request as draft March 23, 2026 15:19
@jafarre-bi jafarre-bi marked this pull request as ready for review March 23, 2026 15:34
@jafarre-bi
Copy link
Contributor Author

@cstamas ready

@jafarre-bi
Copy link
Contributor Author

Thank you! Do I need to do anything else?

@slawekjaranowski slawekjaranowski added the bug Something isn't working label Mar 23, 2026
@slawekjaranowski slawekjaranowski merged commit 1867737 into apache:master Mar 23, 2026
22 checks passed
@github-actions github-actions bot added this to the 4.1.0 milestone Mar 23, 2026
slawekjaranowski pushed a commit to slawekjaranowski/maven that referenced this pull request Mar 23, 2026
…ven.api.di.Inject contains empty lines (apache#11828)

* Fixes issue apache#11827

* Use Java 17 features

* Issue apache#11827 - Trim each read line to avoid related errors

(cherry picked from commit 1867737)
@jafarre-bi jafarre-bi deleted the bugfix/#11827 branch March 24, 2026 08:50
@jafarre-bi jafarre-bi restored the bugfix/#11827 branch March 24, 2026 08:51
@jafarre-bi jafarre-bi deleted the bugfix/#11827 branch March 24, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven DI crashes if the file org.apache.maven.api.di.Inject contains empty lines

3 participants