Library upgrades: Must I include both versions of the library in the recipe jar? #4536
-
Hi, I know you have this doc on the topic. However, it talks a lot about tests. I want to make sure that these should go into Currently, rewrite-spring has a lot of these embedded. Let's say I'm upgrading a Maven project that has
Are lib-a:1 and lib-a:2 generally supposed to come from before-after pom states such that code-rewriting will have appropriate types (both old and new)? Or do I need to include one or both of these in I get why this might be needed in a recipe test (where we don't care that it's going to be used in a Maven project), but I'm a little hazy on this applies in a 'real' environment. Both the doc and rewrite-spring make me think these need to be there. What we've been doing for test purposes is to put these into |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I did search your slack for this:) Only found this. |
Beta Was this translation helpful? Give feedback.
hi! In short the .jars need to be added to
src/.../resources/META-INF/classpath
only when referenced from aJavaParser
call toclasspathFromResources
, either from a unit test, or in a JavaTemplate.classpathFromResources
specifically (as opposed toclasspath(...)
) is only necessary when there could potentially be multiple major versions of a framework or library supported at any one time. So for Spring Boot we support v1, v2, and v3 in parallel, while we need all three of those for recipes and tests across all of those major versions. Elsewhere we might leave out the classpath resources if not immediately needed.In your case you will likely want to
.classpath(...)
as much as possible, e…