mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

Restore this non-bug please (ISSUE 44) #105

Closed Tristan107 closed 6 years ago

Tristan107 commented 6 years ago

Hi,

in this "issue", people asked for the generated sources directory to be added to maven source directory :

ISSUE-44

Now, what if I don't want to use generated classes directly ? And I want to use copies under source control and able to be slightly customized ? Is there a way I remove the generated directory from maven sources ?

Edit : I don't have much time to deal with this, so without any workaround tomorrow, I'll have to switch to an other jaxb2 plugin like maven-jaxb2-plugin.

lennartj commented 6 years ago

Not currently... and moreover, I'm not sure I understand your use case here.

The XSD is the source document definition in case you generate Java code from XML using the xjc. If you want to alter the code generation, the way to do it is via customized bindings as described by the JAXB standard using the XJB. Altering generated code (by hand) is not a case we support.

Tristan107 commented 6 years ago

It's "the way to do it" for sure, but I like to have options for minor customizations when the XSD is stable.

Also you are focusing on this, and not on the "source control" part of my issue. To be more clear : if I ever change the conf of my generation plugin, its version, or even the plugin itself, I want to keep track of the changes in the resulting generated classes, not only keep track of the XSD and the Maven conf.

Anyway, thanks for your fast answer, I'll just move to an other plugin. I'll keep reading if you have a workaround.

Here is the workaround in my answer : https://stackoverflow.com/a/49119531/668455