Combining several JARs into one is pretty straightforward using Maven's assembly feature, except that when the same file exists in multiple JARs, it will be repeatedly overwritten when they are unpacked into a common directory structure. Unfortunately, this means that SezPoz annotations in META-INF/annotations across multiple JARs overwrite one another.
CombineAnnotations can be used to work around this, though it is awkward. Could also use something other than the assembly plugin to create a master JAR; anything that does not rely on combining ZIP entries would work.
But for cases where merging ZIP entries is necessary, an official solution is needed. One possibility is to make an implementation of ContainerDescriptorHandler which would understand how to merge these files. Such a plugin would I presume somehow be added as a dependency to the assembly plugin and then used as part of your assembly descriptor. Resource transformers are also relevant.
Another option would be to change the SezPoz index format to work with simple concatenation, which is more likely to be supported out of the box by assembly tools: #6. (The old index files would need to still be accepted for binary compatibility, of course.)
Originally filed in JIRA.
Combining several JARs into one is pretty straightforward using Maven's assembly feature, except that when the same file exists in multiple JARs, it will be repeatedly overwritten when they are unpacked into a common directory structure. Unfortunately, this means that SezPoz annotations in
META-INF/annotations
across multiple JARs overwrite one another.CombineAnnotations can be used to work around this, though it is awkward. Could also use something other than the assembly plugin to create a master JAR; anything that does not rely on combining ZIP entries would work.
But for cases where merging ZIP entries is necessary, an official solution is needed. One possibility is to make an implementation of ContainerDescriptorHandler which would understand how to merge these files. Such a plugin would I presume somehow be added as a dependency to the assembly plugin and then used as part of your assembly descriptor. Resource transformers are also relevant.
Another option would be to change the SezPoz index format to work with simple concatenation, which is more likely to be supported out of the box by assembly tools: #6. (The old index files would need to still be accepted for binary compatibility, of course.)