An open API service indexing awesome lists of open source software.

https://github.com/gerritcodereview/executablewar

Support for running code directly from WAR files - (mirror of http://gerrit.googlesource.com/executablewar)
https://github.com/gerritcodereview/executablewar

Last synced: 4 months ago
JSON representation

Support for running code directly from WAR files - (mirror of http://gerrit.googlesource.com/executablewar)

Awesome Lists containing this project

README

          

executablewar
=============

This package can be overlaid into a WAR file to make it executable,
automatically loading the WEB-INF/lib directory into the classpath
and launching a different main class.

Add the magic block to your Maven pom.xml, setting the value of
`Executable-War-Package` to the package of your main classes.

With this magic in place, users can execute your WAR file as
a standard JAR, including the class name on the command line:

====
java -jar your.war Action ...
====

At runtime the class `${Executable-War-Package}.${Action}` will be
loaded dynamically from the WEB-INF/lib directory and its static
main method will be invoked with all remaining arguments.

Files under `WEB-INF/` may also be accessed by the built-in actions
`--ls` (list files) and `--cat` (output content to standard out).
This may be useful for user-level documentation to unpack resources
packaged with the application. The `WEB-INF`/ prefix is assumed by
these actions, and should not be specified on the command line.

pom.xml magic
-------------

====



org.apache.maven.plugins
maven-war-plugin



ExecutableWarMain


your.package.prefix




org.apache.maven.plugins
maven-dependency-plugin


make-executable
generate-resources

unpack




gerrit
executablewar
true
${project.build.directory}/executablewar
**/*.class






maven-antrun-plugin


fix-output
process-classes








run







gerrit
executablewar
1.0-SNAPSHOT
provided


====