Search code examples
websphere-libertyopen-liberty

Liberty server properties file setup


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


Solution

  • If you need to define system property the recommended way is to use jvm.options file and put your property there like:

    # Set a system property.
    -Darg.get.prop=ExampleValue
    

    you may need to create that file in the ${server.config.dir} directory. For some more details check Customizing the Liberty environment