Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven plugin should apply recipe to all sub modules in one pass #349

Closed
sambsnyd opened this issue May 4, 2022 · 2 comments
Closed

Maven plugin should apply recipe to all sub modules in one pass #349

sambsnyd opened this issue May 4, 2022 · 2 comments
Assignees
Labels
design-partner-1 enhancement New feature or request
Milestone

Comments

@sambsnyd
Copy link
Member

sambsnyd commented May 4, 2022

Currently each sub-module is parsed independently of each other, and recipe runs are applied only to a sub-module.
It is currently impossible for a Recipe run by the maven plugin to look at information in sub-module A and use that information while visiting a class in sub-module B.

This behavior differs from our Gradle plugin. The Gradle plugin is able to aggregate all subprojects together into a single list of ASTs and Recipes are applied to them together, rather than independently.

I'm not sure how to configure Maven to do this.

@sambsnyd sambsnyd added the enhancement New feature or request label May 4, 2022
@tkvangorder
Copy link
Contributor

To clarify this a bit:

The plugin's project parser is called on each module of a multi-module project (in reactor order). The plugin correctly configures the classpath of the Java parser (using Maven's project settings) to include any transitive project dependencies. This means that the type attribution will be correct.

However, the list of source files generated by the parser will ONLY include the java source for that module. This means that when a recipe is executed, it only operates on source files local to the current module. This will not include source files from other modules (even if they are part of a larger, multi-module build).

@tkvangorder tkvangorder self-assigned this May 8, 2022
@tkvangorder tkvangorder moved this to In Progress in OpenRewrite May 8, 2022
@tkvangorder
Copy link
Contributor

This enhancement has been merged with #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-partner-1 enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants