Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing maven-bundle-plugin with the maven-shade-plugin
    text
    copied!<p>I'm using the maven-shade-plugin to relocate some packages during the package phase of my build. I'm also using the maven-bundle-plugin to generate a manifest. The problem is the bundle plugin runs before the shade plugin (during the process-classes phase), and doesn't include any of my shaded packages in the generated manifest's exports.</p> <p>How can I get these two plugins to play nice with each other, so that my relocated packages are treated like any other package by the bundle plugin?</p> <p>--</p> <p>By request, the Shade and bundle sections of my POM:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&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;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;filters&gt; &lt;filter&gt; &lt;artifact&gt;cglib:cglib&lt;/artifact&gt; &lt;includes&gt; &lt;include&gt;net/sf/cglib/core/**&lt;/include&gt; &lt;include&gt;net/sf/cglib/proxy/**&lt;/include&gt; &lt;/includes&gt; &lt;/filter&gt; &lt;/filters&gt; &lt;relocations&gt; &lt;relocation&gt; &lt;pattern&gt;net.sf.cglib&lt;/pattern&gt; &lt;shadedPattern&gt;org.modelmapper.internal.cglib&lt;/shadedPattern&gt; &lt;/relocation&gt; &lt;relocation&gt; &lt;pattern&gt;org.objectweb.asm&lt;/pattern&gt; &lt;shadedPattern&gt;org.modelmapper.internal.asm&lt;/shadedPattern&gt; &lt;/relocation&gt; &lt;/relocations&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.7&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;bundle-manifest&lt;/id&gt; &lt;phase&gt;process-classes&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;manifest&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;instructions&gt; &lt;Bundle-SymbolicName&gt;${project.artifactId}&lt;/Bundle-SymbolicName&gt; &lt;Export-Package&gt; org.modelmapper, org.modelmapper.builder, org.modelmapper.config, org.modelmapper.convention, org.modelmapper.spi &lt;/Export-Package&gt; &lt;Private-Package&gt; org.modelmapper.internal.** &lt;/Private-Package&gt; &lt;Import-Package&gt; * &lt;/Import-Package&gt; &lt;Include-Resource&gt; {maven-resources}, {maven-dependencies} &lt;/Include-Resource&gt; &lt;/instructions&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>Taken <a href="https://github.com/jhalterman/modelmapper/blob/master/core/pom.xml">from here</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload