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

Using custom MavenEmbedder to launch OpenRewrite results in differing LST #81

Open
fabapp2 opened this issue Apr 19, 2024 · 0 comments
Open

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Apr 19, 2024

After introducing Maven Invoker to launch the OpenRewrite Maven plugin and listen for Maven lifecycle events to access the MavenSession the LST parity tests started failing.
Debugging showed that this appears to be caused by an error in MavenEmbedder which does not provide the correct classpath.
The custom RewriteProjectParser "fixes" this by creating the classpath differently. This is a prerequisite to allow "partial parsing" of a sub-tree of the build module hierarchy.
This leads to a situation where the OpenRewrite code does not produce a valid LST and thus the LST is incorrect and differs from the LST produced by RewriteProjectParser.

Possible Solutions

One solution to this problem would be to raise the level of abstraction and not compare LSTs but the produced output of recipes applied with each parser (RewriteProjectParser and OpenRewrite's MavenMojoProjectParser) to verify parity.

The existing test should not be removed because they'd be valuable when the problem is solved.

fabapp2 added a commit to fabapp2/spring-rewrite-commons that referenced this issue Apr 19, 2024
fabapp2 added a commit that referenced this issue Apr 19, 2024
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

No branches or pull requests

1 participant