Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
WAR into standalone JAR transformer
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
jwarpack-cli
jwarpack-distribution
jwarpack-es
jwarpack-maven-plugin
jwarpack-packager
pom.xml
readme.md

readme.md

jwarpack

Overview

The jwarpack project aims to provide a simple way of turning WAR into standalone application (JAR file) which doesn't require external web container.

This type of artifact can be used in number of cases:

  • your application is simple enough and you don't want external server to be involved
  • your application is not that simple but you still want to use standalone bundle as a normal release artifact (just like it does YouTrack)

How does it work

The JAR file created by jwarpack contains embedded server classes (provided by one of the jwarpack-es modules, jwarpack-es-jetty6 for example) and the original web application. Once launched, main class bootstraps web container, deploys application and opens URL in a browser (if requested).

Usage

Arbitrary WAR file can be transformed into standalone JAR using one of the methods below.

After that, application can be run using "java -jar yourapp-standalone.jar start".

Maven

Note: Plugin is not yet available in Maven Central.

        <plugin>
            <groupId>com.github.shyiko.jwarpack</groupId>
            <artifactId>jwarpack-maven-plugin</artifactId>
            <version>1.0</version>
            <dependencies>
                <dependency>
                    <groupId>com.github.shyiko.jwarpack.es</groupId>
                    <artifactId>jwarpack-es-jetty6</artifactId>
                    <version>1.0</version>
                </dependency>
                <dependency>
                    <groupId>yourapp-groupid</groupId>
                    <artifactId>yourapp-artifactid</artifactId>
                    <version>yourapp-version</version>
                    <type>war</type>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <goals>
                        <goal>pack</goal>
                    </goals>
                    <phase>package</phase>
                </execution>
            </executions>
        </plugin>

Tip: Use following link to get the latest version of plugin available in Maven Central.

CLI

java -jar jwarpack-cli-1.0.jar jwarpack-distribution-1.0/es/jwarpack-jetty6-1.0.jar yourapp.war yourapp-standalone.jar

History

Project was developed during the work on jmxweb.

License

Apache License, Version 2.0

Something went wrong with that request. Please try again.