Download and connect on java-based web servers.
To solve this I need to create a generic task that serves as a hook to download, deploy, start and shutdown an external server that does not runs in node. Node would be used only for build.
grunt-java-server task acts as a hook to start an external server, without worrying about the back-end language your application uses.
This task has the same purpose of grunt-contrib-connect. The difference is that it uses java-based web servers instead of a node-based one.
Want to contribute with another server? Check out the server configs file
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-java-server --save-dev
Run this task with the
grunt servers command.
Note that this server only runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. This behavior can be changed with the keepalive option.
This task was designed to be used in conjunction with another task that is run immediately afterwards, like the grunt-contrib-qunit plugin
It may be necessary to kill the server process in the end of all tasks execution for cleanup, otherwise the server process stays running until the
servers task is executed again. For that, use the
:kill flag (see example below).
The server configs that is going to be used. By default, the task downloads the latest final Wildfly version.
The target directory that should be used to store the downloaded and extracted server files.
By default it uses the
target directory relative to the Gruntfile location.
An array of key-value pairs to be passed to the server upon startup as arguments.
If a function is passed, it is called with the first argument representing the server home directory.
Keep the server alive indefinitely. By default, once grunt's tasks have completed, the web server stops. This option changes that behavior.