Search code examples
javagradleopenrewrite

OpenRewrite: Not visiting files from src/main/resources directory


I am using OpenRewrite recipe org.openrewrite.DeleteSourceFiles to delete some files. But it is not detecting or deleting files from src/main/resources directory or src/test/resources. I have basic gradle java project which have src/main/java src/main/resources src/test/java & src/test/resources directories. I am using gradle plugin of openrewrite to run recipe.

I tried running this recipe in dry run mode with "**" as filePattern just to check what all files it detects. Seems like it does not even detect files from src/main/resources & src/test/resources. It detects files from src/main/java, src/test/java & also some other random directories I have at the root but not resources under main or test. Due to this it doesn't delete it. Not sure what's the issue specifically with resources directories?


Solution

  • The fix for this issue is now available in rewrite-gradle-plugin 6.8.3 and rewrite-maven-plugin 5.23.0.

    Your debugging narrowing the problem to TreeWalk helped to fix this! I've made this commit to rewrite-polyglot so that it produces the same list of files-to-parse on Windows as it does on unix-style paths.