Questions tagged [openrewrite]

OpenRewrite is a software product that automates refactoring of code. Use this tag for questions regarding the OpenRewrite product.

OpenRewrite enables large-scale distributed source code refactoring.

OpenRewrite is hosted on GitHub: https://github.com/openrewrite
There is also a documentation site: https://docs.openrewrite.org/

43 questions
0
votes
1 answer

Openrewrite systemouttologging recipe not working

https://docs.openrewrite.org/recipes/java/logging/systemouttologging I am trying to apply the follwing recipe on a gradle project, but the recipe doesnt apply changes to my files. Here is the build.gradle file. enter image description here Here is…
0
votes
1 answer

Openrewrite exclude class/method from replacing

I recently started using the openrewrite and wanted to know if there is any way we can exclude a class or method from replacing with a any recipe. I have some unit test that is specifically used to test maps with null key uisng…
reflexdemon
  • 836
  • 8
  • 21
0
votes
1 answer

How can I fix the NoSuchMethodError while using the open-rewrite plugin for migrating Spring Boot 1.5.x to 2.7.x?

Error while trying to migrate srping boot 1.5.x to 2.7.x using open-rewrite Using this plugin org.openrewrite.maven rewrite-maven-plugin 4.44.0
0
votes
1 answer

Open Rewrite :Refactoring with declarative YAML recipes

I have been following the instructions Refactoring with declarative YAML recipes. In my case project "A" is a multi-module maven build. I added a module "functional" that has an Example.yml under src/main/resources/META-INF/rewrite. I see…
Christopher Helck
  • 1,130
  • 2
  • 8
  • 23
0
votes
2 answers

OpenRewrite NullPointer while adding a maven dependency

I am running a recipe on Mac OS from the command line using rewrite plugin version 4.46.0 The project is a multi module maven. mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -e -Drewrite.activeRecipes=com.xxx.upgrade_18 My rewrite.yml is…
Christopher Helck
  • 1,130
  • 2
  • 8
  • 23
0
votes
1 answer

OpenRewrite: What is a "quark"?

When I run a recipe I see messages like this one: Parsing as quark .../my_big_cucumber.feature as its size 12Mb exceeds size threshold 10Mb What does this message mean? I also see the message for json files. Clearly the files are too big, but what…
Christopher Helck
  • 1,130
  • 2
  • 8
  • 23
0
votes
1 answer

Write an Openrewrite java recipe test ignoring compilation errors

Is it possible to write an Openrewrite java recipe test ignoring compilation errors due to unknown class types not included in JavaParser classpath? Example: @Test void requiredRequestParam() { rewriteRun( spec ->…
0
votes
2 answers

Error while running openrewrite UpgradeSpringBoot_3_0

I upgraded my repo to 2.7.1 using UpgradeSpringBoot_2_7 and project built successfully. Now when i try to upgrade to SpringBoot 3.0.x , rewrite:run fails with error : Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] I don't find any…
Dinesh
  • 57
  • 2
  • 8
0
votes
1 answer

Is there any Recipe to move a file from one location to another?

for a smooth migration I'm looking for a recipe in Open-Rewrite to move a file (in that case a configuration File which always has the same name) from one location (for example C:\project\mymodule\test.conf) to another (for example…
0
votes
1 answer

OpenRewrite: The contents of a quark are unknown, so the charset is unknown

I want to execute the migration of my source code from Java8 to Jave11 using the OpenRewrite plugin and the recipe of the following link:https://docs.openrewrite.org/reference/recipes/java/migrate/java8tojava11. As the guide suggests, I have added…
Marco Fantasia
  • 720
  • 8
  • 12
0
votes
1 answer

How to apply a recipe on a specific method parameter

In my recipe I select the method parameters which have both the NotNull and RequestParam annotations and I want to apply the OpenRewrite recipe AddOrUpdateAnnotationAttribute on these method parameters to set the required attribute to true of the…
0
votes
1 answer

OpenRewrite: how to visit sourceFiles with a custom extension in a JAVA Project?

I am creating a recipe to modify a final JAVA project according to certain conditions. The use case would be: IF there is a file called "file.test" in the project. THEN I add a maven property to the project's pom.xml It seems simple, but I can't…
-1
votes
1 answer

OpenRewrite: Enabling local Maven repository during JUnit testing of a recipe?

I wrote an OpenRewrite recipe which changes Maven pom.xml from containing this: a b 1.0.0 To this: c
Lukáš Petrovický
  • 3,945
  • 1
  • 11
  • 20
1 2
3