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

Skip Invalid Transitive Dependency When Resolving Maven Dependencies #5112

Open
XiaoSK opened this issue Mar 2, 2025 · 0 comments
Open

Skip Invalid Transitive Dependency When Resolving Maven Dependencies #5112

XiaoSK opened this issue Mar 2, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@XiaoSK
Copy link

XiaoSK commented Mar 2, 2025

What problem are you trying to solve?

When applying a Recipe (such as OrderImports) to a Maven project, during the execution of the rewrite-maven-plugin plugin, if an undefined version of a transitive dependency is encountered due to an irregular pom.xml of a dependency, the plugin will fail with a "No version provided" error.

Describe the solution you'd like

In fact, under Maven's default build behavior, Maven merely issues a warning: “[WARNING] The POM for groupId:artifactId:packing:version is invalid, transitive dependencies (if any) will not be available” without blocking the build process. Such irregular pom.xml files are indicative of technical debt, and the goal of OpenRewrite is to eliminate this technical debt. However, I believe that during the execution of the rewrite-maven-plugin, it should align with Maven’s default behavior by issuing only warnings and ignoring the transitive dependencies instead of blocking the execution. At the very least, the plugin should provide an optional Maven argument to allow ignoring and skipping such cases.

This would enhance the plugin's compatibility, allowing it to work more seamlessly with a wider range of projects that may have varying levels of technical debt or dependency management issues. By providing this flexibility, users can choose to bypass non-critical errors without compromising the overall build process, thus improving the robustness and adaptability of the plugin in different environments.

@XiaoSK XiaoSK added the enhancement New feature or request label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant