Links

Frequently asked questions

Does OpenRewrite collect any data from our projects?

No. The rewrite-maven-plugin and rewrite-gradle-plugin run locally on your machine, without any connections to Moderne or OpenRewrite. The plugins calls out to Maven Central (or a locally configured mirror) to check for new dependencies. Other than that, you should not see any other outbound traffic.

I'm getting java.lang.OutOfMemoryError: Java heap space when running OpenRewrite.

You can increase the size of the Java heap to see if that helps:
Gradle
Maven
gradle -Dorg.gradle.jvmargs=-Xmx8G rewrite:run
export MAVEN_OPTS="-Xmx8G"
mvn rewrite:run

My recipe appears to hang when running. What's happening? Is there a progress report?

OpenRewrite is likely building up a model of your code and resolving types – this can take a while. Right now, there is not a progress report for recipe runs. However, there is a suggestion to add progress indicators that you can +1 here.

Can I create a report or summary of the changes made through OpenRewrite?

Yes. Take a look at the getting started with data tables guide. Right now, data tables can only be accessed through the Moderne platform. Access to these will be made available through the Maven and Gradle plugin soon.

I want to exclude a single recipe from a collection of recipes.

This is not possible right now and doing so would be quite complicated. For a detailed explanation as to why, check out this post.

Is it possible to pass arguments to a recipe from the command line? I want to programmatically configure complex recipes.

Not right now. This is a particularly difficult problem to address for a couple of reasons:
  • Some recipes can be composed of other recipes which could then include other recipes composed of other recipes and so on.
  • Some recipes can be used multiple times in one recipe with different parameters such as in this example.
There is an open issue for this request that you can +1 or provide feedback on.