timtebeek commented on PR #1066:
URL: https://github.com/apache/maven/pull/1066#issuecomment-1475047817

   Here's a first PR to standardize on Commons-Lang3 StringUtils in Apache 
Maven core. It uses the following recipes:
   ```yaml
   type: specs.openrewrite.org/v1beta/recipe
   name: com.github.timtebeek.PlexusStringUtilsToCommonsLang3
   displayName: Replace Plexus StringUtils with Commons Lang3
   description: https://issues.apache.org/jira/browse/MNG-6825
   recipeList:
     - org.openrewrite.java.ChangeType:
         oldFullyQualifiedTypeName: org.codehaus.plexus.util.StringUtils
         newFullyQualifiedTypeName: org.apache.commons.lang3.StringUtils
     - org.openrewrite.java.ChangeMethodTargetToStatic:
         methodPattern: org.codehaus.plexus.util.StringUtils clean(String)
         fullyQualifiedTargetTypeName: org.apache.commons.lang3.StringUtils
     - org.openrewrite.java.ChangeMethodName:
         methodPattern: org.apache.commons.lang3.StringUtils clean(String)
         newMethodName: trimToEmpty
     - org.openrewrite.java.ChangeType:
         oldFullyQualifiedTypeName: org.apache.maven.shared.utils.StringUtils
         newFullyQualifiedTypeName: org.apache.commons.lang3.StringUtils
   ```
   
   Couldn't yet remove the maven-shared/plexus-utils dependencies everywhere, 
as there's still references to other classes such as 
`org.apache.maven.shared.utils.logging.MessageUtils`, as found through: 
[F0jjf.xlsx](https://github.com/apache/maven/files/11009924/F0jjf.xlsx)
   ```yaml
   type: specs.openrewrite.org/v1beta/recipe
   name: com.github.timtebeek.MNG-6825
   displayName: MNG-6825
   description: https://issues.apache.org/jira/browse/MNG-6825
   recipeList:
     - org.openrewrite.java.search.FindMethods:
         methodPattern: org.apache.maven.shared.utils..* *(..)
     - org.openrewrite.java.search.FindMethods:
         methodPattern: org.codehaus.plexus.util..* *(..)
   ```
   
   Note that the above recipes are most easily executed by [creating a custom 
repository group](https://public.moderne.io/settings/repo-groups), and then 
[uploading the yaml into the recipe 
builder](https://public.moderne.io/recipes/builder), after which a Dry run 
should give results in a couple seconds.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to