You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2015/08/18 18:47:02 UTC
svn commit: r962244 - in /websites/production/cxf/content:
cache/docs.pageCache
docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html
Author: buildbot
Date: Tue Aug 18 16:47:02 2015
New Revision: 962244
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html
==============================================================================
--- websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html (original)
+++ websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html Tue Aug 18 16:47:02 2015
@@ -28,6 +28,15 @@
<meta name="description" content="Apache CXF, Services Framework - Bundling CXF into single jar with Maven shade plugin">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
+
+<script src='/resources/highlighter/scripts/shCore.js'></script>
+<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
+<script>
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+</script>
<title>
@@ -107,7 +116,134 @@ Apache CXF -- Bundling CXF into single j
<td height="100%">
<!-- Content -->
<div class="wiki-content">
-<div id="ConfluenceContent"></div>
+<div id="ConfluenceContent"><p>I've noticed that when using CXF as a Maven dependency and aggregating it into an uber-Jar using the Maven Shade plugin there is an issue in that by default, the <span>META-INF/cxf/bus-extensions.txt</span> file (and other necessary CXF resources) aren't aggregated properly and loaded properly. They are kept in separate files. For examples of this, see:</p><ol><li><style>
+ .jira-issue {
+ padding: 0 0 0 2px;
+ line-height: 20px;
+ }
+
+ .jira-issue img {
+ padding-right: 5px;
+ }
+ .jira-issue .aui-lozenge {
+ line-height: 18px;
+ vertical-align: top;
+ }
+
+ .jira-issue .icon {
+ background-position: left center;
+ background-repeat: no-repeat;
+ display: inline-block;
+ font-size: 0;
+ max-height: 16px;
+ text-align: left;
+ text-indent: -9999em;
+ vertical-align: text-bottom;
+ }
+</style>
+
+ <span class="jira-issue TIKA-1712"><a shape="rect" class="issue-link" href="https://issues.apache.org/jira/browse/TIKA-1712?src=confmacro">TIKA-1712</a></span>
+</li><li><style>
+ .jira-issue {
+ padding: 0 0 0 2px;
+ line-height: 20px;
+ }
+
+ .jira-issue img {
+ padding-right: 5px;
+ }
+ .jira-issue .aui-lozenge {
+ line-height: 18px;
+ vertical-align: top;
+ }
+
+ .jira-issue .icon {
+ background-position: left center;
+ background-repeat: no-repeat;
+ display: inline-block;
+ font-size: 0;
+ max-height: 16px;
+ text-align: left;
+ text-indent: -9999em;
+ vertical-align: text-bottom;
+ }
+</style>
+
+ <span class="jira-issue CXF-6545"><a shape="rect" class="issue-link" href="https://issues.apache.org/jira/browse/CXF-6545?src=confmacro">CXF-6545</a></span>
+<br clear="none"><br clear="none"></li></ol><p>The fix is to use the Maven Shade Plugin's AppendingTransformer to combine all the copies of the bus-extensions.txt file present in the jars. See these examples here:</p><p><a shape="rect" class="external-link" href="https://fisheye6.atlassian.com/browse/cxf/osgi/bundle/all/pom.xml?r=12acd46e3dbe98fa1321374b09174d5876271f08#to448" rel="nofollow">https://fisheye6.atlassian.com/browse/cxf/osgi/bundle/all/pom.xml?r=12acd46e3dbe98fa1321374b09174d5876271f08#to448</a></p><p><a shape="rect" class="external-link" href="https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer">https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer</a></p><p>You can handle it with the plugin configuration for the Shade plugin e.g., like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom
-width: 1px;"><b>Shade Plugin Example</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: true; first-line: 1; theme: Default" style="font-size:12px;"><plugin>
+<artifactId>maven-shade-plugin</artifactId>
+<executions>
+<execution>
+<phase>package</phase>
+<goals>
+<goal>shade</goal>
+</goals>
+
+<configuration>
+<createDependencyReducedPom>false</createDependencyReducedPom>
+<filters>
+<filter>
+<artifact>*:*</artifact>
+<excludes>
+<exclude>META-INF/*</exclude>
+<exclude>LICENSE.txt</exclude>
+<exclude>NOTICE.txt</exclude>
+<exclude>CHANGES</exclude>
+<exclude>README</exclude>
+<exclude>builddef.lst</exclude>
+<!-- clutter not needed in jar -->
+<exclude>resources/grib1/nasa/README*.pdf</exclude>
+<exclude>resources/grib1/**/readme*.txt</exclude>
+<exclude>resources/grib2/**/readme*.txt</exclude>
+<!--
+ TIKA-763: Workaround to avoid including LGPL classes
+-->
+<exclude>ucar/nc2/iosp/fysat/Fysat*.class</exclude>
+<exclude>ucar/nc2/dataset/transform/VOceanSG1*class</exclude>
+<exclude>ucar/unidata/geoloc/vertical/OceanSG*.class</exclude>
+</excludes>
+</filter>
+</filters>
+
+
+<transformers>
+<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+<mainClass>org.apache.tika.cli.TikaCLI</mainClass>
+</transformer>
+
+<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
+<resource>META-INF/LICENSE</resource>
+<file>target/classes/META-INF/LICENSE</file>
+</transformer>
+
+<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
+<resource>META-INF/NOTICE</resource>
+<file>target/classes/META-INF/NOTICE</file>
+
+</transformer>
+
+
+<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
+<resource>META-INF/DEPENDENCIES</resource>
+<file>target/classes/META-INF/DEPENDENCIES</file>
+
+</transformer>
+
+<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+<resource>META-INF/cxf/bus-extensions.txt</resource>
+
+</transformer>
+</transformers>
+
+</configuration>
+</execution>
+
+</executions>
+
+</plugin></pre>
+</div></div></div>
</div>
<!-- Content -->
</td>