You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by oc...@apache.org on 2009/07/29 11:24:43 UTC
svn commit: r798819 -
/maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm
Author: oching
Date: Wed Jul 29 09:24:39 2009
New Revision: 798819
URL: http://svn.apache.org/viewvc?rev=798819&view=rev
Log:
[MSHADE-58]
o include sample config for AppendingTransformer
Modified:
maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm
Modified: maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm?rev=798819&r1=798818&r2=798819&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/site/apt/examples/resource-transformers.apt.vm Wed Jul 29 09:24:39 2009
@@ -98,3 +98,43 @@
...
</project>
+-----
+
+* Merging Content of Specific Files
+
+ Some jars contain additional resources (such as properties files) that have the same file name. To avoid overwriting, you can
+ opt to merge them by appending their content into one file. One good example for this is when aggregating both the spring-context
+ and plexus-spring jars. Both of them have the <<<META-INF/spring.handlers>>> file which is used by Spring to handle XML schema
+ namespaces. You can merge the contents of all the files with that specific name using the <<<AppendingTransformer>>> as shown below:
+
++-----
+<project>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+ <resource>META-INF/spring.handlers</resource>
+ </transformer>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----
+
+ For XML files, you can use the <<<XmlAppendingTransformer>>> instead.
\ No newline at end of file