(Quick Reference)

run-war

Purpose

Packages the current Grails application into a Web Application Archive (WAR) file and runs the application in a Tomcat container on port 8080 (by default).

Examples

Ejecutar WAR

Propósito

Empaquetar dentro de un Archivo de Aplicación Web (WAR) la aplicación Grails actual y ejecuta dicha aplicación en un contenedor Tomcat en el puerto 8080 (por defecto).

Ejemplos

grails run-war
grails run-war -https // with HTTPS
grails run-war -restart // restarts without rebuilding the war
grails prod run-war
grails -Dserver.port=8090 run-war

Description

Usage:

Descripción

Uso:

grails [env]* run-war

Unlike the war command, run-war default to the development environment (like most commands). To build and run a WAR file for a different environment just specify the environment name, e.g. grails prod run-war.
A diferencia del comando war, run-war por defecto para el entorno de desarrollo (como la mayoría de los comandos). Para construir y ejecutar un fichero WAR para diferentes entornos basta con especificar el nombre del entorno, por ejemplo: grails prod run-war

Arguments:
  • https - Start an HTTPS server (on port 8443 by default) alongside the main server. Just to be clear, the application will be accessible via HTTPS and HTTP.
  • restart - Does not rebuild an already existing WAR.

Supported system properties:

  • grails.server.port.http/server.port - Specifies the HTTP port to run the server on (defaults to 8080)
  • grails.server.port.https - Specifies the HTTPS port to run the server on (defaults to 8443)
  • grails.server.host/server.host - Specifies the host name to run the server on (defaults to localhost)
  • grails.tomcat.jvmArgs - A list of JVM arguments to be used for the forked JVM, e.g. ["-Xms128m", "-Xmx512m"] (defaults to ["-Xmx512m"])

Argumentos:
  • https - Inicio de HTTPS (en el puerto 8443 por defecto), junto con los servidores principales. Es decir, la aplicación será accesible a través de HTTPS y HTTP.
  • https - No reconstruir el WAR ya existente.

Propiedades del sistema soportadas:

  • grails.server.port.http/server.port - Especificar el puerto HTTP para ejecutarlo en el servidor (por defecto el 8080)
  • grails.server.port.https - Especificar el puerto HTTPS para ejecutarlo en el servidor (por defecto el 8443)
  • grails.server.host/server.host - Especificar el nombre del host para ejecutarlo en el servidor (por defecto localhost)
  • grails.tomcat.jvmArgs - Una lista de argumentos JVM para ser utilizará para el forked JVM , por ejemplo ["-Xms128m", "-Xmx512m"] (por defecto ["-Xmx512m"])

Fired Events:

  • StatusFinal - When the container has been started
  • StatusUpdate - When the container is reloading

This command packages your application into a WAR file and then runs it in the installed container. It is useful for quick deployment and/or testing. However, unlike run-app this command does not support reloading as a Grails WAR archive does not ship with Groovy sources, but only compiled byte code.

  • StatusFinal - Cuando el contenedor ha sido iniciado
  • StatusUpdate - Cuando el contenedor es recargado

Este comando empaqueta su aplicación en un fichero WAR y entonces lo ejecuta en el contenedor instalado. Es útil para el rápido despliegue y/o testeo. Sin embargo, a diferencia de run-app este comando no soporta la recarga como los archivos WAR de Grails no se distribuye con código Groovy, pero solo el código compilado.