Skip to content

test: add integration test for modular processor with shared dependencies#1042

Merged
desruisseaux merged 1 commit intoapache:maven-4.1from
mariuszs:fix/modular-processor-shared-deps
Mar 28, 2026
Merged

test: add integration test for modular processor with shared dependencies#1042
desruisseaux merged 1 commit intoapache:maven-4.1from
mariuszs:fix/modular-processor-shared-deps

Conversation

@mariuszs
Copy link
Copy Markdown

@mariuszs mariuszs commented Mar 15, 2026

Integration test for #1039.

The underlying issue (same GAV with different types resolved to a single path) is being fixed in Maven core via apache/maven#11805. This PR adds a regression test only — no compiler plugin code changes.

@desruisseaux
Copy link
Copy Markdown
Contributor

I think that the analysis is correct and this pull request seems to address the issue, but as a workaround. Ideally, it seems to me that the issue should be addressed in Maven core or in Maven resolver. It would allow to add only the dependencies that were really requested, instead of adding all dependencies that could potentially have been requested.

I was hopping that apache/maven#11380 would help, but maybe it is only a first step. If I'm guessing correctly (I have not yet verified with a step-by-step debugging), the above-cited PR 11380 fixes the type of transitive dependencies when the type is only modular-processor, but we still have the issue that if a dependency is declared with both modular-processor and modular-jar types, only one of those types win while actually we need to keep both. @cstamas do yo think that this analysis is correct?

@cstamas
Copy link
Copy Markdown
Member

cstamas commented Mar 19, 2026

Yes, it is. Using same GAV with different types is no-go currently.

@desruisseaux
Copy link
Copy Markdown
Contributor

Yes, it is. Using same GAV with different types is no-go currently.

So, it is correct to said that apache/maven#11805 tries to make that possible?

@desruisseaux
Copy link
Copy Markdown
Contributor

For information, I verified that when using Maven 4.1.0-SNAPSHOT with the apache/maven#11805 patch applied, the test provided in this pull request passes with not need to change anything in the compiler code (i.e. with ToolExecutor changes reverted).

@mariuszs mariuszs closed this Mar 27, 2026
@desruisseaux
Copy link
Copy Markdown
Contributor

Actually, instead of closing it, I was thinking to just discard the changes in ExecutorTool and keep the integration test.

@mariuszs mariuszs reopened this Mar 27, 2026
@mariuszs mariuszs changed the title Supplement processor-module-path with module-path dependencies test: add integration test for modular processor with shared dependencies Mar 27, 2026
@mariuszs mariuszs force-pushed the fix/modular-processor-shared-deps branch from 73eaaec to 1cc7927 Compare March 27, 2026 13:29
@mariuszs
Copy link
Copy Markdown
Author

Done.

@desruisseaux
Copy link
Copy Markdown
Contributor

desruisseaux commented Mar 28, 2026

I pushed a maven-4.1 branch. Can you edit this pull request for targeting that branch? This is because the master branch targets Maven 4.0.x, while this test requires Maven 4.1.

@desruisseaux desruisseaux self-assigned this Mar 28, 2026
@desruisseaux desruisseaux added this to the 4.0.0 milestone Mar 28, 2026
@mariuszs mariuszs changed the base branch from master to maven-4.1 March 28, 2026 14:07
@desruisseaux desruisseaux merged commit ec14b74 into apache:maven-4.1 Mar 28, 2026
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.

3 participants