https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath

 

 

1. Create a new module for your configuration files

jboss-as-7/modules/com/yourcompany/configuration/main/module.xml

 Note that from JBossAS 7.2.0.Final and newer (including WildFly 8.x), the module directory structure was changed for JBossAS/WildFly components only. You should continue to use the structure described above. See Layered Distributions and Module Path Organization for more information.

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <module xmlns="urn:jboss:module:1.1" name="com.mycompany.configuration">  
  3.     <resources>  
  4.         <resource-root path="."/>  
  5.     </resources>  
  6. </module>  

2. Add your properties files to the module

jboss-as-7/
   modules/
      com/
         yourcompany/
            configuration/
               main/
                 module.xml
                 settings.properties
                 other-settings.xml

3. Add your module to your application classpath in a jboss-deployment-structure.xml file

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <jboss-deployment-structure>  
  3.   <deployment>  
  4.     <dependencies>  
  5.       <module name="com.mycompany.configuration" />  
  6.     </dependencies>  
  7.   </deployment>  
  8. </jboss-deployment-structure>  
Posted by 張's blog
,