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

Parse `target/generated-sources`

Open fabapp2 opened this issue 2 years ago • 2 comments

Looking at the given details I assume the problem is that the interface is not found because target/generated-sources is not scanned (yet) and thus the code is not part of the AST and the interface 'Xyz' could not be resolved. The easiest/fastest way to verify my assumption would be to move the generated classes from target/... to some src/main/java and see if the type can then be resolved, which should be the case.

Nevertheless, this should be changed and needs an enhancement of the MavenProjectParser to parse generated-sources. A challenge I see right now is that SBM would need to verify that a build was done before scanning the application and that recent artifacts exist under target. This is not the most straightforward piece of code in SBM but if you are motivated to look into it I'm more than happy to assist.

Originally posted by @fabapp2 in https://github.com/spring-projects-experimental/spring-boot-migrator/issues/590#issuecomment-1353043605

fabapp2 avatar Dec 15 '22 13:12 fabapp2

As a workaround additional source paths could be passed into SBM using a command line parameter.

fiveOO avatar Dec 15 '22 13:12 fiveOO

This will be fixed with #771. The ProjectParser then parses all resources ending with .java in target. These will be available for tape resolution but not be part of the AST.

fabapp2 avatar May 10 '23 11:05 fabapp2