spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

Epic: Extract OpenRewrite parser

Open fabapp2 opened this issue 2 years ago • 2 comments

What needs to be done

The parsing logic to create the OpenRewrite AST from given resources should be extracted. The currently used MavenProjectParser should then be replaced by this component.

Why it needs to be done

Parsing a given project to OpenRewrite AST is a mandatory step to apply OpenRewrite recipes. Currently, two open-sourced build tool plugins exist that allow applying recipes inside a build. Providing a parser that creates the AST outside of a build tool plugin is required for other projects too. Extracting the parser allows reusing this component in these projects.

  • [x] #832
  • [x] #855
  • [ ] #849
  • [x] #856
  • [x] All markers should be added exactly as if the project would have been parsed with the build tool plugins
  • [ ] The ExecutionContext should be made available as scoped bean, reusing #792 and #800
  • [ ] All Java versions supported by OpenRewrite must be supported (https://github.com/spring-projects-experimental/spring-boot-migrator/issues/837)
  • [ ] The component should be configurable through Spring properties
    • [ ] A rewrite.yaml should read and the settings should be taken
  • [ ] Exception handling should be configurable
    • [ ] When to throw and when to log
    • [ ] how to communicate exceptions (print in resource, collect, ...)
  • [ ] Build information (ordered list of build files, dependencies for modules, and other) can be provided
  • [ ] #982
  • [ ] Allow different pom and artifact caches
  • [ ] #78
  • [ ] Provide a common interface and make parser implementation configurable (RewriteMavenProjectParser vs. RewriteProjectParser)
  • [ ] Support Maven profiles(?)
  • [ ] Add tests
    • [ ] Test that dependencies are downloaded when local repo is empty
    • [ ] Integration tests using local artifact repository (e.g. Artfactory) with credentials to retrieve dependencies
    • [x] #991

Acceptance Criteria

/info panel Given precondition When action Then result

Additional Information

fabapp2 avatar Jul 20 '23 09:07 fabapp2

@fabapp2 any idea when the support for custom maven settings.xml support would be added ? Adhere to ~/.m2/settings-security.xml and ~/.m2/settings.xml

shresthaujjwal avatar Aug 07 '23 16:08 shresthaujjwal

Hi @shresthaujjwal

it should be working with the current parser used in isolation when using RewriteMavenProjectParser which replicates works as with the rewrite-maven-plugin. It needs to be incorporated into the RewriteProjectParser and can be taken fron here. I will find or create an issue for this.

fabapp2 avatar Aug 09 '23 11:08 fabapp2