Move spring-data-mongodb to compileOnly
dependency
#623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's your motivation?
Up to now we had had a runtime spring-data-mongodb dependency, as seen in:
https://repo1.maven.org/maven2/org/openrewrite/recipe/rewrite-spring/5.22.0/rewrite-spring-5.22.0.pom
But we've seen this fail when organizations block access to vulnerable dependencies, as I had a case today where the excluded
spring-core:5.2.12.RELEASE
lead to a 404 and failure to install the rewrite-spring recipe jar, via this chain of downloadshttps://repo1.maven.org/maven2/org/springframework/data/spring-data-mongodb/2.2.12.RELEASE/spring-data-mongodb-2.2.12.RELEASE.pom
https://repo1.maven.org/maven2/org/springframework/data/spring-data-mongodb-parent/2.2.12.RELEASE/spring-data-mongodb-parent-2.2.12.RELEASE.pom
https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/2.2.12.RELEASE/spring-data-parent-2.2.12.RELEASE.pom
With the change we drop that runtime classpath dependency, but possible break the recipe.
Anything in particular you'd like reviewers to focus on?
The generated recipe still uses
JavaParser.runtimeClasspath()
; I'm wondering if this change will break that, and/or whether we should switch to usingclasspathFromResources
there, and possibly then drop the Refaster recipeAnyone you would like to review specifically?
@knutwannheden
Have you considered any alternatives or workarounds?