maven-shade-plugin
maven-shade-plugin copied to clipboard
[MSHADE-149] XmlAppendingTransformer not adequate for aop-ajc.xml files
Pascal Pochet opened MSHADE-149 and commented
When merging aop-ajc.xml files (== merging several AspectJ jars...), XmlAppendingTransformer generates: <aspectj> <aspects> ...aspects of jar 1 </aspects> <aspects> ...aspects of jar 2 </aspects> ... <aspects> ...aspects of jar N </aspects> <aspectj> instead of <aspectj> <aspects> ...aspects of jar 1 ...aspects of jar 2
...aspects of jar N
</aspects> <aspectj>
Solution: add the attached transformer to the list of existing ones.
and in pom.xml:
<transformer implementation="org.apache.maven.plugins.shade.resource.AopAjcXmlResourceTransformer"> <resource>META-INF/aop-ajc.xml</resource> </transformer>
NB A more general solution would be to add a parameter to XmlAppendingTransformer to specify the XML level to merge... (maybe as a XPath expression ?)
Attachments:
- AopAjcXmlResourceTransformer.java (3.61 kB)