You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by Ambarish Pande <am...@gmail.com> on 2017/01/20 12:12:50 UTC
Packaging apex app using maven-shade plugin.
Hello Everyone,
I have tried and successfully packaged apex app using maven shade plugin.
1. Remove the maven-assembly plugin and replace it with the following shade
plugin.
<!--Maven shaded plugin for assembling the apa-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>bin</shadedClassifierName>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/*</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
2. Replace the target in maven-antrun plugin with this :
<target>
<move file="${project.build.directory}/${project.artifactId}-${project.version}-bin.jar"
tofile="${project.build.directory}/${project.artifactId}-${project.version}.apa"
/>
</target>
3. Uncomment the following from the default pom.xml to exlude transitive
dependencies.
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
Here is the complete pom.xml
https://gist.github.com/ambarishpande/45f98b40d3640fa9b1f5c6a1f0167a27
Hope it helps someone in need.
Thank you.