0

I am trying to generate jaxb2 classes on an Intellij Build.

I mean this button :

enter image description here

You can use this project as a template : https://github.com/spring-guides/gs-consuming-web-service/tree/master/complete. If you checkout the project and try to build it, you'll see it does not compile. You have to run a mvn:compile, which is, to me, not really obvious if you a working in a team and you don't know there are supposed to be generated classes.

It would be better if it could work with this build.

I've seen it is possible with mapstruct so I guess it could with jaxb2 as well. Do you know how to do that? Maybe some configuration in the pom...

Thanks.

Clemzd
  • 895
  • 2
  • 15
  • 35

1 Answers1

1

If you include the generated sources folder in your project definition then this will be picked up by the IntelliJ build process as detailed here...

Unable to use Intellij with a generated sources folder

Depending on your exact requirements, however, you may also want to get IntelliJ to generate the sources which is detailed here

IntelliJ Jaxb code generation

AdamPillingTech
  • 456
  • 2
  • 7
  • The problem is the build does not generate jaxb2 classes. And anyway it's more complicated to use this option that run a maven compile. – Clemzd Dec 18 '17 at 13:04
  • I understand. Perhaps it is worth raising a feature request with JetBrains to be able to turn on code gen as part of the 'Build Project' process – AdamPillingTech Dec 18 '17 at 13:21
  • I was thinking more of a maven tip to do that – Clemzd Dec 18 '17 at 13:59