This page talks about how to bring application specific or external property file (any kind of file) into JBoss AS 7.x in the application classpath. Whenever we deploy our application into the application server like JBoss, it is good practice to seperate property files, configuration related files, etc out of deployment bundle. This way we can make sure that any configuration changes does not requires new build. We can edit the configurations in the external files and restart the application. Here are the steps to put external files into the JBoss AS 7.0 and above application classpath: 1) Create a new module for your application configuration files in the JBoss Create folder structure as shown below and place a file called module.xml inside the last folder. jboss-as-7-home-folder/modules/com/your-company/configuration/main/module.xml Update your module.xml file with below shown content:
2) Add all property files under main folder You have already created folder structure, move all your property files under main folder, these files should be placed along with module.xml file. 3) Create jboss-deployment-structure.xml file in your application and map your module in the xml Create jboss-deployment-structure.xml file under your application WEB-INF directory of your WAR file. Update your jboss-deployment-structure.xml file with the given below content:
4) Load a properties file from the classloader in your application
| |||||||||
How to load external property file in JBoss 7 classpath?
最新推荐文章于 2022-10-18 10:21:50 发布