I have properties file in local to which I am reading in code by below method String pathOfFile = System.getProperties("arg.get.prop");
How to set this system properties to get my property file's path in liberty server.xml
I have properties file in local to which I am reading in code by below method String pathOfFile = System.getProperties("arg.get.prop");
How to set this system properties to get my property file's path in liberty server.xml
You can specify environment variables in the server.env file placed either in ${wlp.install.dir}/etc/server.env or ${server.config.dir}/server.env. The server will also pick up variables from the current shell environment (server.env files take precedence). Then you can access the variables in the server.xml using the following notation:
${env.<variable name>}
For example, you can have the following in your server.env file:
HTTP_PORT=9001
and then in your server.xml:
<httpEndpoint id="defaultHttpEndpoint"
httpPort="${env.HTTP_PORT}"
httpsPort="9443" />
For more information on customizing the Liberty environment see: https://www.ibm.com/support/knowledgecenter/en/SSAW57_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_customvars.html
If you need to define system property the recommended way is to use
jvm.options
file and put your property there like:you may need to create that file in the
${server.config.dir}
directory. For some more details check Customizing the Liberty environment