apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ambarish Pande <ambarish.pande2...@gmail.com>
Subject Packaging apex app using maven-shade plugin.
Date Fri, 20 Jan 2017 12:12:50 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message