3 Replies Latest reply on Jun 7, 2016 1:38 AM by Nicklas Karlsson

    Two properties files for two instance of same application

    Syed Mahdi Apprentice

      We have a deployment topology that sometimes we deploy the application for test environment and prod environment on the same jboss server but in their own context. Now we are migrating to Wildfly. In Jboss we would have two contexts each having its own deploy folder and we would put the config.properties in their own respective deploy folders. Now in Wildfly, we have an issue.

      1) the location of the config.properties is in the jboss-deployment-structure.xml which is inside the WEB-INF folder. if we deploy the same war file in two different Wildfly contexts then both of them will look into the same place for the config.properties, but one is test and one is DR or Prod.

      for this we will have to package the war again differently for the prod and the test and supply a different module for the properties file.

      2) we could supply these properties in the system properties in the standalone.xml but the war application is actually configured to look for classpath:config.properties.

       

      What should we do in such a scenario. The idea of a properties file is that properties are externalized so that it can change depending on environment, but now the reference of it (jboss-deployment-structure.xml) is now part of the war/ear itself. Is there a way we can provide the jboss deployment structure external to the war so that it can be provided in the context.