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)
- Host: GitHub
- URL: https://github.com/gerritcodereview/executablewar
- Owner: GerritCodeReview
- License: apache-2.0
- Created: 2015-12-10T09:32:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-09-13T19:57:10.000Z (over 2 years ago)
- Last Synced: 2025-07-18T04:26:12.596Z (7 months ago)
- Language: Java
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
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
====