JBoss deploy cli command

JBoss deploy cli command below for reference,

Connect to the Jboss Console using ./jboss-cli.sh –connect command based on standalone mode or domain mode configuration. Once connected, issue below command to check the commands available and then use deploy command.

help –commands

JBoss deploy cli command

Issue, deploy –help to get overview of the command and its usage.

JBoss deploy cli command

 

Below is the command that will be used for deployment in Jboss CLI mode (i am using Domain mode here). I have already placed the WAR file into /tmp location and I am deploying to main-server-group as part of server-groups.

deploy <pathtoDeploymentfile> –server-groups=<groupname>

 

Below are the ARGUMENTS available for the deploy command from JBoss CLI mode (taken from command prompt when executing the command).

file_path – filesystem path to the application to deploy. If the deployment has to be added or replaced in the repository, either the file_path or the –url argument is required. The path can be either absolute or relative to the current
directory.

–url – URL at which the deployment content is available for upload to the deployment content repository. Note that the
URL must be accessible from the target of the operation (i.e. the Domain Controller or standalone server). If the deployment has to be added or replaced in the repository, either the file_path or the –url argument is required.
The path can be either absolute or relative to the current directory.

–name – the unique name of the deployment. If the file path argument is specified the name argument is optional with
the file name been the default value. If the file path argument isn’t specified then the command is supposed to enable an already existing but disabled deployment, and in this case the name argument is required.

–runtime-name – optional, the runtime name for the deployment. This will form the basis for such things as default Java EE
application and module names. This would typically be the same as –name, and if not specified the value used for –name will be used. In some cases users may wish to have two deployments with the same ‘runtime-name’ (e.g. two versions of “example.war”) both available in the management configuration, in which case the deployments would need to have distinct ‘name’ values but would have the same ‘runtime-name’. Within an individual server, only one deployment with a given ‘runtime-name’ can deployed. However, multiple deployments with the same ‘runtime-name’ can exist in the configuration, so long as only one is enabled.

–force – if the deployment with the specified name already exists, by default, deploy will be aborted and the corresponding
message will printed. Switch –force (or -f) will force the replacement of the existing deployment with the one specified in the command arguments.

–disabled – indicates that the deployment has to be added to the repository disabled.

–unmanaged – if this argument is not specified, the deployment content will be copied (i.e. uploaded) to the server’s deployment repository before it is deployed. If the argument is present, the deployment content will remain at and be
deployed directly from its original location specified with the file_path. NOTE: exploded deployments are supported only as unmanaged.

–server-groups – comma separated list of server group names the deploy command should apply to. Either server-groups or all-server-groups is required in the domain mode. This argument is not applicable in the standalone mode.

–all-server-groups – indicates that deploy should apply to all the available server groups. Either server-groups or all-server-groups is required in domain mode. This argument is not applicable in the standalone mode.

-l in case none of the required arguments is specified the command will print all of the existing deployments in the
repository. The presence of the -l switch will make the existing deployments printed one deployment per line, instead of in columns (the default).

–headers – a list of operation headers separated by a semicolon. For the list of supported headers, please, refer to the domain management documentation or use tab-completion.

–script – optional, can appear only if the file_path points a cli archive. The value is the name of the script contained in a
cli archive to execute. If not specified, defaults to ‘deploy.scr’. A cli archive is a zip archive containing script(s) as well as artifacts or applications to deploy. To be recognized as a cli archive, the extension of the archive file should be ‘.cli’. The deploy command will execute the script given by the –script argument. All paths in the scripts are relative to the root directory in the cli archive. The script is executed as a batch.

 

Please find Jboss Documentation link for deploy CLI command here.