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>&#160;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;">&lt;plugin&gt;
+&lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
+&lt;executions&gt;
+&lt;execution&gt;
+&lt;phase&gt;package&lt;/phase&gt;
+&lt;goals&gt;
+&lt;goal&gt;shade&lt;/goal&gt;
+&lt;/goals&gt;
+
+&lt;configuration&gt;
+&lt;createDependencyReducedPom&gt;false&lt;/createDependencyReducedPom&gt;
+&lt;filters&gt;
+&lt;filter&gt;
+&lt;artifact&gt;*:*&lt;/artifact&gt;
+&lt;excludes&gt;
+&lt;exclude&gt;META-INF/*&lt;/exclude&gt;
+&lt;exclude&gt;LICENSE.txt&lt;/exclude&gt;
+&lt;exclude&gt;NOTICE.txt&lt;/exclude&gt;
+&lt;exclude&gt;CHANGES&lt;/exclude&gt;
+&lt;exclude&gt;README&lt;/exclude&gt;
+&lt;exclude&gt;builddef.lst&lt;/exclude&gt;
+&lt;!--  clutter not needed in jar  --&gt;
+&lt;exclude&gt;resources/grib1/nasa/README*.pdf&lt;/exclude&gt;
+&lt;exclude&gt;resources/grib1/**/readme*.txt&lt;/exclude&gt;
+&lt;exclude&gt;resources/grib2/**/readme*.txt&lt;/exclude&gt;
+&lt;!--
+ TIKA-763: Workaround to avoid including LGPL classes 
+--&gt;
+&lt;exclude&gt;ucar/nc2/iosp/fysat/Fysat*.class&lt;/exclude&gt;
+&lt;exclude&gt;ucar/nc2/dataset/transform/VOceanSG1*class&lt;/exclude&gt;
+&lt;exclude&gt;ucar/unidata/geoloc/vertical/OceanSG*.class&lt;/exclude&gt;
+&lt;/excludes&gt;
+&lt;/filter&gt;
+&lt;/filters&gt;
+
+
+&lt;transformers&gt;
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
+&lt;mainClass&gt;org.apache.tika.cli.TikaCLI&lt;/mainClass&gt;
+&lt;/transformer&gt;
+
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/&gt;
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"&gt;
+&lt;resource&gt;META-INF/LICENSE&lt;/resource&gt;
+&lt;file&gt;target/classes/META-INF/LICENSE&lt;/file&gt;
+&lt;/transformer&gt;
+
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"&gt;
+&lt;resource&gt;META-INF/NOTICE&lt;/resource&gt;
+&lt;file&gt;target/classes/META-INF/NOTICE&lt;/file&gt;
+
+&lt;/transformer&gt;
+
+
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"&gt;
+&lt;resource&gt;META-INF/DEPENDENCIES&lt;/resource&gt;
+&lt;file&gt;target/classes/META-INF/DEPENDENCIES&lt;/file&gt;
+
+&lt;/transformer&gt;
+
+&lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
+&lt;resource&gt;META-INF/cxf/bus-extensions.txt&lt;/resource&gt;
+
+&lt;/transformer&gt;
+&lt;/transformers&gt;
+
+&lt;/configuration&gt;
+&lt;/execution&gt;
+
+&lt;/executions&gt;
+
+&lt;/plugin&gt;</pre>
+</div></div></div>
            </div>
            <!-- Content -->
          </td>