Clemzd
Clemzd

Reputation: 945

How to generate jaxb2 classes on Intellij build?

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.

Upvotes: 1

Views: 275

Answers (1)

AdamPillingTech
AdamPillingTech

Reputation: 466

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

Upvotes: 1

Related Questions