mojohaus / jaxb2-maven-plugin

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

Generated episode file is not included in final jar. #39

Closed jinahya closed 6 years ago

jinahya commented 8 years ago

The entry(META-INF/sun-jaxb.episode) which is generated in target/generated-sources/jaxb is not included in final jar.

I checked the source code and it seems that XjcMojo#addResource(Resource) is not called, apparently.

I suggest, additionally, to use target/generated-resources/ if it's possible.

lennartj commented 8 years ago

Do we need to rename the generated episode file?

jinahya commented 8 years ago

No, I think. The pathname should be remained as META-INF/sun-jaxb.episode.

lennartj commented 8 years ago

We need some mechanics to enable renaming or move the episode file within the generated JAR. Otherwise, we make it impossible to perform 2 JAXB compilations and stash both results in the final JAR.

This scenario is rather common when having more than 1 version of an XSD being JAXB compiled and stashed in a compound JAR. In this scenario, only one episode file would be stashed within the resulting JAR. (Which would likely cause loads of problems).

lennartj commented 8 years ago

Renaming slated for 2.3.1 release.

lennartj commented 6 years ago

For each JAXB compilation, schemagen will create a new schema file.

From a usability perspective we would like to name the file in a way which would its origin JAXB compilation apparent/obvious. There are 2 ways to achieve this:

  1. Better way: The user supplies a name for the episode file for each JAXB execution. This needs to be pointed out in the documentation.
  2. Convenient way: The automatically generated episode file name must correlate to its JAXB execution ID or equivalent.