Types of variable references

References to System Properties

Variable references to system properties start with ${, followed by the name of the variable, and end with }. An example of a variable reference that refers to a java.home system property is:

${java.home}

Values of system properties can be specified by:

  • the JVM (standard JVM properties like java.home)

  • Payara Server (a set of predefined variables, such as com.sun.aas.instanceRoot)

  • the create-system-properties asadmin command (or in the Admin console System properties section)

  • a JVM option prefixed with -D

When custom properties are specified, their value can also contain other variable references. It is therefore possible to define a system property using other system properties or environment variables.

References to environment variables

Environment variable references are used like system property references, but contain an extra ENV qualifier and equals sign before the variable name. An example of a reference to an environment variable HOME then looks like:

${ENV=HOME}
${ENV=MAYBE_AVAILABLE:default}

Environment variables need to be specified in the environment before a Payara instance is started. By adding a colon after the variable name, you may append a default value if the variable has not been set.

References to password aliases

References to password aliases are used to refer to a password which is stored securely in the domain’s keystore. They are treated in a special way and cannot be mixed with other variable references and with other characters in the same configuration value. They are only supposed to be used as a value anywhere a password is expected in the configuration.

Password aliases look like system property references, but contain an extra ALIAS qualifier and equals sign before the alias name. Whenever used, the configuration value can only contain a password alias and nothing more.

An example of a reference to a password alias called cluster-password for an attribute admin-password looks like:

admin-password="${ALIAS=cluster-password}"

References to MicroProfile Properties

MicroProfile property references can be used exactly like an environment variable reference, but using the MPCONFIG qualifier. An example of a reference to a MicroProfile property called foo would look like:

${MPCONFIG=foo}
${MPCONFIG=bar:default}

MicroProfile properties need to be declared in one of the Payara defined config sources. By adding a colon after the property name, you may append a default value if the property has not been set.