I do not see them in domain.xml or host.xml
They are at the top level in <server> for standalone or <domain> for such a domain
<server xmlns="urn:jboss:domain:1.7"> ... <system-properties> <property name="myapp.env" value="dev"/> </system-properties> ... </server>
then Spring can see this as ${myapp.env} or any other code as system code.
They can be installed from the JBoss Admin Console, as well as on the “Configuration” tab at the very bottom of “System Properties” - this is actually the contents of this <system-properties> in domain.xml
They can also be used inside domain.xml. As an example, if you have myapp.properties files in different directories based on your environment, you can do this as:
<server xmlns="urn:jboss:domain:1.7"> ... <system-properties> <property name="myapp.env" value="dev"/> <property name="myapp.config.file" value="${myapp.env}/myapp.properties"/> </system-properties> ...
Thus, the path to the file will be dev/myapp.properties , and Spring will see it as $ {myapp.config.file}, after which it can load the properties.
PS. Also, as I recall, certain system properties can be set in the module definition or even in the application deployment descriptor jboss-deployment-structure.xml - not sure about the latter ... BTW this does not apply to your question about differentiation by environment.
SFC. About how .properties is stored on the file system. Storing them in a JAR file is a bad idea. it needs to be rebuilt and deployed every time a property is changed.
.properties files to avoid this. Therefore, they must be out of deployment.
Therefore, it depends on the organization’s network policy.
From time to time it was an NFS directory with different file names such as dev_myapp.properties, test_myapp.properties, etc.
At other times, it was one NFS directory with subdirectories - dev, test, etc. with the same file name in each.
NFS is not allowed in my current organization. Each slave instance in the cluster has its own clone file in the same place, i.e. config/myapp.properties . therefore, there is only one system property, defined as the path to this file. Each environment has its own version of the file.
Good luck