0

I'm using maven-jaxb2-plugin to generate some classes in taget/generated-sources. Since I upgraded from IntelliJ 2019 to 2021.3 these generated classes are not recognized by the IDE anymore, even though the build works fine.

enter image description here

If I manually mark generated sources as Sources, it works fine. But after mvn clean install, I have to redo the process.

The previous version of IntellIj was able to set generated-sources as Sources by default. Can I replicate this behaviour on the newer version? I played a bit in Settings > Build Execution > Maven > Importing. But with no luck

UnguruBulan
  • 890
  • 4
  • 12
  • 24
  • Looks like https://youtrack.jetbrains.com/issue/IDEA-123702 issue, when genertaed sources directory is not recognized properly for the `maven-jaxb2-plugin` plugin. – Andrey Jan 14 '22 at 08:00
  • First, please make sure that the source directory resets even when you have the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Importing | **Keep source and test folders on project reload** option is enabled. Then to help IDE to recognize the genrated source directory you can declare the generated sources directory explicitly (either in the jaxb maven plugin configuration or use maven-compiler or build-helper maven plugins) like e.g. https://stackoverflow.com/a/42226970/2000323 – Andrey Jan 14 '22 at 08:00

0 Answers0