Pack200 Maven Plugin

A simple and flexible pack200 plugin for Apache Maven.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.github.pixeon.plugins
ArtifactId

ArtifactId

maven-pack200-plugin
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Pack200 Maven Plugin
A simple and flexible pack200 plugin for Apache Maven.
Project URL

Project URL

https://github.com/Pixeon/Maven-Pack200-Plugin
Source Code Management

Source Code Management

https://github.com/Pixeon/Maven-Pack200-Plugin

Download maven-pack200-plugin

How to add to project

<plugin>
    <groupId>com.github.pixeon.plugins</groupId>
    <artifactId>maven-pack200-plugin</artifactId>
    <version>1.1.0</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.0
org.apache.maven : maven-project jar 2.0
org.codehaus.plexus : plexus-utils jar 2.0.1

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

Maven Pack200 Plugin

Maven Central

A plugin that enables using the pack200 compression tool within Apache Maven2+ builds, simply and flexibly.

Why?

It was originally developed for optimizing download sizes and startup performance of Apache Pivot-based applications deployed via Java Webstart. It was developed carefully to provide a general solution for both signed and unsigned jars with pack200.

There is support for pack200 in the Webstart Maven Plugin, but the plugin's approach was too rigid and monolithic, assuming and dictating too much about how the build and deployment worked. This plugin grants full control over using the JDK's pack200 tool, allowing one to configure and bind executions to Maven build phases as needed directly while retaining the flexibility to package your application as you wish.

Requirements

To use this plugin, you'll need:

Building

To build the plugin, simply run the following:

# Build and install the plugin
mvn install

Configuration

You configure the plugin as you would any maven plugin, in the project object model file, pom.xml. At a minimum, you need to declare the plugin and bind it to your build's phases.

The following example configures the plugin to run twice:

  • Pack and unpack, so crypto signatures are valid after decompression
  • Pack the jar in final optimized form

Between these two phases, you normally configure jar signing.

<plugins>
   <plugin>
      <groupId>com.github.batkinson.plugins</groupId>
      <artifactId>maven-pack200-plugin</artifactId>
      <version>1.0.1</version> <!-- ensure this matches your version -->
      <executions>
         <execution>
            <id>normalize-jars</id>
            <phase>package</phase>
            <goals>
               <goal>pack</goal>
            </goals>
            <configuration>
               <normalizeOnly>true</normalizeOnly>
            </configuration>
         </execution>
         <execution>
            <id>pack-jars</id>
            <phase>verify</phase>
            <goals>
               <goal>pack</goal>
            </goals>
            <configuration>
               <normalizeOnly>false</normalizeOnly>
            </configuration>
         </execution>
      </executions>
   </plugin>
</plugins>

Example

For a complete working example, take a peek at the OXD Form Designer Project. It builds an Apache Pivot-based application as a shaded (all dependencies included) signed and optimized jar.

com.github.pixeon.plugins

Pixeon

Versions

Version
1.1.0