简体   繁体   English

如何在Intellij构建上生成jaxb2类?

[英]How to generate jaxb2 classes on Intellij build?

I am trying to generate jaxb2 classes on an Intellij Build. 我正在尝试在Intellij Build上生成jaxb2类。

I mean this button : 我的意思是这个按钮:

在此处输入图片说明

You can use this project as a template : https://github.com/spring-guides/gs-consuming-web-service/tree/master/complete . 您可以将该项目用作模板: https : //github.com/spring-guides/gs-consumption-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. 您必须运行一个mvn:compile ,对我来说,如果您在团队中工作并且不知道应该生成类,这并不是很明显。

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. 我已经看到mapstruct有可能,所以我想jaxb2也有可能。 Do you know how to do that? 你知道怎么做吗? Maybe some configuration in the pom... 也许在pom中进行一些配置...

Thanks. 谢谢。

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... 如果在项目定义中包括生成的sources文件夹,那么IntelliJ构建过程将对此进行选择,如此处所述...

Unable to use Intellij with a generated sources folder 无法将Intellij与生成的源文件夹一起使用

Depending on your exact requirements, however, you may also want to get IntelliJ to generate the sources which is detailed here 但是,根据您的确切要求,您可能还希望使IntelliJ生成源,此处将对此进行详细说明。

IntelliJ Jaxb code generation IntelliJ Jaxb代码生成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM