## wildfly:execute-commands

Full name:

org.wildfly.plugins:wildfly-maven-plugin:3.0.0.Final:execute-commands

Description:

Execute commands to the running WildFly Application Server. Commands should be formatted in the same manor CLI commands are formatted. Executing commands in a batch will rollback all changes if one command fails.

         <batch>true</batch>
         <fail-on-error>false</fail-on-error>
         <commands>
             <command>/subsystem=logging/console=CONSOLE:write-attribute(name=level,value=DEBUG)</command>
         </commands>

Attributes:

- Requires a Maven project to be executed.

### Optional Parameters

Name | Type | Since | Description
--- | --- | --- | ---
authenticationConfig | URL | - | A URL which points to the authentication configuration (wildfly-config.xml) the client uses to authenticate with the server. User property is: wildfly.authConfig. Alias is: authentication-config.
batch | boolean | - | true if commands should be executed in a batch or false if they should be executed one at a time. Default value is: false. User property is: wildfly.batch.
commands | List | - | The CLI commands to execute. User property is: wildfly.commands.
failOnError | boolean | - | Indicates whether or not subsequent commands should be executed if an error occurs executing a command. A value of false will continue processing commands even if a previous command execution results in a failure. Note that this value is ignored if offline is set to true. Default value is: true. User property is: wildfly.failOnError. Alias is: fail-on-error.
fork | boolean | 2.0.0 | Indicates the commands should be run in a new process. If the jboss-home property is not set an attempt will be made to download a version of WildFly to execute commands on. However it's generally considered best practice to set the jboss-home property if setting this value to true. Note that if offline is set to true this setting really has no effect. WARNING: In 3.0.0 you'll be required to set the jboss-home. An error will occur if this option is true and the jboss-home is not set. Default value is: false. User property is: wildfly.fork.
hostname | String | - | Specifies the host name of the server where the deployment plan should be executed. Default value is: localhost. User property is: wildfly.hostname.
id | String | - | Specifies the id of the server if the username and password is to be retrieved from the settings.xml file User property is: wildfly.id.
javaOpts | String[] | - | The JVM options to pass to the offline process if the offline configuration parameter is set to true. User property is: wildfly.javaOpts. Alias is: java-opts.
jbossHome | String | - | The WildFly Application Server's home directory. This parameter is required when offline is set to true. Otherwise this is not required, but should be used for commands such as module add as they are executed on the local file system. User property is: jboss-as.home. Alias is: jboss-home.
offline | boolean | - | Indicates whether or not CLI scrips or commands should be executed in an offline mode. This is useful for using an embedded server or host controller. This does not start an embedded server it instead skips checking if a server is running. Default value is: false. User property is: wildfly.offline.
password | String | - | Specifies the password to use if prompted to authenticate by the server. If no password is specified and the server requests authentication the user will be prompted to supply the password, User property is: wildfly.password.
port | int | - | Specifies the port number the server is listening on. Default value is: 9990. User property is: wildfly.port.
propertiesFiles | List | - | The properties files to use when executing CLI scripts or commands.
protocol | String | - | The protocol used to connect to the server for management. User property is: wildfly.protocol.
resolveExpressions | boolean | 3.0 | Resolve expressions prior to send the commands to the server. Default value is: false. User property is: wildfly.resolveExpressions. Alias is: resolve-expressions.
scripts | List | - | The CLI script files to execute. User property is: wildfly.scripts.
skip | boolean | - | true if commands execution should be skipped. Default value is: false. User property is: wildfly.skip.
stdout | String | - | Indicates how stdout and stderr should be handled for the spawned CLI process. Currently a new process is only spawned if offline is set to true or fork is set to true. Note that stderr will be redirected to stdout if the value is defined unless the value is none. By default stdout and stderr are inherited from the current process. You can change the setting to one of the follow: none indicates the stdout and stderr stream should not be consumed System.out or System.err to redirect to the current processes (use this option if you see odd behavior from maven with the default value) Any other value is assumed to be the path to a file and the stdout and stderr will be written there Default value is: System.out. User property is: wildfly.stdout.
systemProperties | Map | - | The system properties to be set when executing CLI commands. Alias is: system-properties.
timeout | int | - | The timeout, in seconds, to wait for a management connection. Default value is: 60. User property is: wildfly.timeout.
username | String | - | Specifies the username to use if prompted to authenticate by the server. If no username is specified and the server requests authentication the user will be prompted to supply the username, User property is: wildfly.username.

### Parameter Details

authenticationConfig:

A URL which points to the authentication configuration (wildfly-config.xml) the client uses to authenticate with the server.

- Type: java.net.URL
- Required: No
- User Property: wildfly.authConfig
- Alias: authentication-config

batch:

true if commands should be executed in a batch or false if they should be executed one at a time.

- Type: boolean
- Required: No
- User Property: wildfly.batch
- Default: false

commands:

The CLI commands to execute.

- Type: java.util.List
- Required: No
- User Property: wildfly.commands

failOnError:

Indicates whether or not subsequent commands should be executed if an error occurs executing a command. A value of false will continue processing commands even if a previous command execution results in a failure.

Note that this value is ignored if offline is set to true.

- Type: boolean
- Required: No
- User Property: wildfly.failOnError
- Default: true
- Alias: fail-on-error

fork:

Indicates the commands should be run in a new process. If the jboss-home property is not set an attempt will be made to download a version of WildFly to execute commands on. However it's generally considered best practice to set the jboss-home property if setting this value to true.

Note that if offline is set to true this setting really has no effect.

WARNING: In 3.0.0 you'll be required to set the jboss-home. An error will occur if this option is true and the jboss-home is not set.

- Type: boolean
- Since: 2.0.0
- Required: No
- User Property: wildfly.fork
- Default: false

hostname:

Specifies the host name of the server where the deployment plan should be executed.

- Type: java.lang.String
- Required: No
- User Property: wildfly.hostname
- Default: localhost

id:

Specifies the id of the server if the username and password is to be retrieved from the settings.xml file

- Type: java.lang.String
- Required: No
- User Property: wildfly.id

javaOpts:

The JVM options to pass to the offline process if the offline configuration parameter is set to true.

- Type: java.lang.String[]
- Required: No
- User Property: wildfly.javaOpts
- Alias: java-opts

jbossHome:

The WildFly Application Server's home directory.

This parameter is required when offline is set to true. Otherwise this is not required, but should be used for commands such as module add as they are executed on the local file system.

- Type: java.lang.String
- Required: No
- User Property: jboss-as.home
- Alias: jboss-home

offline:

Indicates whether or not CLI scrips or commands should be executed in an offline mode. This is useful for using an embedded server or host controller.

This does not start an embedded server it instead skips checking if a server is running.

- Type: boolean
- Required: No
- User Property: wildfly.offline
- Default: false

password:

Specifies the password to use if prompted to authenticate by the server. If no password is specified and the server requests authentication the user will be prompted to supply the password,

- Type: java.lang.String
- Required: No
- User Property: wildfly.password

port:

Specifies the port number the server is listening on.

- Type: int
- Required: No
- User Property: wildfly.port
- Default: 9990

propertiesFiles:

The properties files to use when executing CLI scripts or commands.

- Type: java.util.List
- Required: No

protocol:

The protocol used to connect to the server for management.

- Type: java.lang.String
- Required: No
- User Property: wildfly.protocol

resolveExpressions:

Resolve expressions prior to send the commands to the server.

- Type: boolean
- Since: 3.0
- Required: No
- User Property: wildfly.resolveExpressions
- Default: false
- Alias: resolve-expressions

scripts:

The CLI script files to execute.

- Type: java.util.List
- Required: No
- User Property: wildfly.scripts

skip:

true if commands execution should be skipped.

- Type: boolean
- Required: No
- User Property: wildfly.skip
- Default: false

stdout:

Indicates how stdout and stderr should be handled for the spawned CLI process. Currently a new process is only spawned if offline is set to true or fork is set to true. Note that stderr will be redirected to stdout if the value is defined unless the value is none.
By default stdout and stderr are inherited from the current process. You can change the setting to one of the follow:

- none indicates the stdout and stderr stream should not be consumed
- System.out or System.err to redirect to the current processes (use this option if you see odd behavior from maven with the default value)
- Any other value is assumed to be the path to a file and the stdout and stderr will be written there

- Type: java.lang.String
- Required: No
- User Property: wildfly.stdout
- Default: System.out

systemProperties:

The system properties to be set when executing CLI commands.

- Type: java.util.Map
- Required: No
- Alias: system-properties

timeout:

The timeout, in seconds, to wait for a management connection.

- Type: int
- Required: No
- User Property: wildfly.timeout
- Default: 60

username:

Specifies the username to use if prompted to authenticate by the server. If no username is specified and the server requests authentication the user will be prompted to supply the username,

- Type: java.lang.String
- Required: No
- User Property: wildfly.username