Skip to content

Conversation

@sparsick
Copy link
Contributor

@sparsick sparsick commented Jan 6, 2026

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

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MSOURCES-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MSOURCES-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify -Prun-its to make sure integration tests checks pass. A more thorough check will
    be performed on your pull request automatically.

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.

@slawekjaranowski
Copy link
Member

Please also update in .github/workflows/maven-verify.yml

- update deps
- related to issue apache#249

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
- update plugin api
- update plugin test tool
- related to issue apache#249

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
- fix compiler error
- commented resource logic part

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
- add replacment for resource logic

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
- add replacment for resource logic
- adjust mocks for tests

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
@sparsick
Copy link
Contributor Author

sparsick commented Jan 6, 2026

Tests are failing only when they are run together.

- fix tests; root cause: ACCESSIBLE_FIELD_CACHE of EnhancedCompositeBeanHelper had invalid information. Clear cache after every class helps

Signed-off-by: Sandra Parsick <sandra@parsick.dev>
@sparsick
Copy link
Contributor Author

sparsick commented Jan 7, 2026

The root cause of the problem:

EnhancedCompositeBeanHelper in maven-core is responsible for setting the right values for the mojo properties. In this case, both mojos (SourceJarMojo and TestSourceJarMojo) have the same properties. The helper is reusing an internal cache (ACCESSIBLE_FIELD_CACHE) for both mojos, and therefore for the run of the second mojo, the information of the cache is invalid because the field of the second mojo has to be set to accessible, but this step is skipped because the cache is filled.

In the unit tests, a workaround is to add EnhancedCompositeBeanHelper.clearCaches(); as a cleanup step. In the invoker tests it is not possible.

@gnodet: Is this behavior a bug? Or do you have a hint how to avoid it?

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.

2 participants