Adam Bien's Weblog
Deploying from command line with WildFly
wildfly comes with a Command Line Interface (CLI) with access to administrative tasks.
The CLI is also usable in "non-interactive" mode from scripts. The following command deploys an application:
$WILDFLY_HOME/bin/jboss-cli.sh --connect --command="deploy --force [PATH_TO_WAR]"
Undeploying an application works adequately:
$WILDFLY_HOME/bin/jboss-cli.sh --connect --command="undeploy x-ray.war"
WildFly'S CLI, similarly to GlassFish'S, is only thin wrapper over a HTTP interface. You could also interact with the server directly over HTTP.
Also the CLI returns proper exit codes and gives you so feedback about the command. Exit codes are a significant benefit over copying a file to a deployment directory.
Special Events: Java 8 with Java EE 7: "More Power with Less Code", 13th October, 2014 and Java EE 7: "Testing and Code Quality", 14th October, 2014 Tweet Follow @AdamBien