Rename OpenSymphony / XWork classes to Struts 7 packages
Recipe ID
org.openrewrite.java.struts.migrate7.RenameOpenSymphonyToStruts2Artifactorg.openrewrite.recipe:rewrite-strutsUpdates classes moved from com.opensymphony.xwork2.* to their new org.apache.struts2.* packages in Struts 7.
Composite recipeProprietary
Add to your build
Get a download tokenThis recipe is Moderne licensed, so the token must belong to a Moderne customer. It replaces YOUR_DOWNLOAD_TOKEN below.
~/.gradle/gradle.properties
codeGenomeUsername=you@example.com
codeGenomeToken=YOUR_DOWNLOAD_TOKEN
build.gradle.kts
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.java.struts.migrate7.RenameOpenSymphonyToStruts2")
}
repositories {
mavenCentral()
maven {
url = uri("https://artifacts.codegenomeproject.org/maven")
credentials {
username = providers.gradleProperty("codeGenomeUsername").get()
password = providers.gradleProperty("codeGenomeToken").get()
}
}
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-struts:0.29.0")
}
Then run
./gradlew rewriteRunUsage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.struts.migrate7.RenameOpenSymphonyToStruts2If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-struts:RELEASEDefinition
This recipe runs the following recipes in order.
- Change type
com.opensymphony.xwork2.Actiontoorg.apache.struts2.action.Actionorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.ActionChainResulttoorg.apache.struts2.result.ActionChainResultorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.TextProvidertoorg.apache.struts2.text.TextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.CompositeTextProvidertoorg.apache.struts2.text.CompositeTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.DefaultTextProvidertoorg.apache.struts2.text.DefaultTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.LocalizedTextProvidertoorg.apache.struts2.text.LocalizedTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.ResourceBundleTextProvidertoorg.apache.struts2.text.ResourceBundleTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.TextProviderFactorytoorg.apache.struts2.text.TextProviderFactoryorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.TextProviderSupporttoorg.apache.struts2.text.TextProviderSupportorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.util.AbstractLocalizedTextProvidertoorg.apache.struts2.text.AbstractLocalizedTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.util.GlobalLocalizedTextProvidertoorg.apache.struts2.text.GlobalLocalizedTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.util.StrutsLocalizedTextProvidertoorg.apache.struts2.text.StrutsLocalizedTextProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.DefaultLocaleProvidertoorg.apache.struts2.locale.DefaultLocaleProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.DefaultLocaleProviderFactorytoorg.apache.struts2.locale.DefaultLocaleProviderFactoryorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.LocaleProvidertoorg.apache.struts2.locale.LocaleProviderorg.openrewrite.java.ChangeType - Change type
com.opensymphony.xwork2.LocaleProviderFactorytoorg.apache.struts2.locale.LocaleProviderFactoryorg.openrewrite.java.ChangeType - Rename package name
com.opensymphony.xwork2toorg.apache.struts2org.openrewrite.java.ChangePackage
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats