3 Replies Latest reply on Jan 16, 2019 12:32 PM by jewellgm

    How to Load external property files without using module.xml ?

    vamshi1413

      I have several application related properties that are required during application/server startup. Is there a way to load the properties without declaring them as global modules under EE subsystem ?

        • 1. Re: How to Load external property files without using module.xml ?
          jewellgm

          There's a way to load properties files at startup via the "-P" or "--properties" parameter.  If you do that, though, you may also need to include the properties that wildfly itself needs (home directory, configuration file, etc.) in your file.

           

          You can also specify individual properties with the "-D" parameter from the command line.  You could potentially write a script to loop through a properties file, and launch wildfly with the properties that were parsed by the script.

           

          Finally, you can enter individual properties into the configuration file (standalone.xml, standalone-full.xml, etc.), but that's probably not any better for you than using the module approach.

          • 2. Re: How to Load external property files without using module.xml ?
            vamshi1413

            For 1 or 2 properties I could use the parameter to load the properties but I have bunch of properties, is there a different parameter or can we include just the path to properties and load multiple properties using a directory ?

            • 3. Re: How to Load external property files without using module.xml ?
              jewellgm

              As my original response said, you can try to use the "-P" parameter to point to a properties file.  If you do that, the properties file may need to include properties that are needed by jboss/wildfly itself.  You'd just need to test that.

               

              Another option is to write a script (batch  or shell, depending on your platform) that parses your properties file(s), and then just constructs that command line parameters to start jboss/wildfly.