如何将文件夹添加到 JBOSS EAP 6 类路径

How to add a folder to JBOSS EAP 6 Classpath

我尝试了以下方法,但未能成功将我的属性文件检索到输入流中。

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

我的项目 : https://github.com/manojp1988/Learning/tree/master/Sample

Jboss文件夹结构:

您需要将模块添加到您的应用程序类路径(How to put an external file in the classpath 的第 3 步):

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

<?xml version="1.0" encoding="UTF-8"?>  
<jboss-deployment-structure>  
  <deployment>  
    <dependencies>  
      <module name="com.mycompany.configuration" />  
    </dependencies>  
  </deployment>  
</jboss-deployment-structure>  

This file must be placed either in the META-INF directory of your EAR file or the WEB-INF directory of your WAR file. See Class Loading in AS7 for more information.

or add your module to your application classpath using a MANIFEST.MF entry:

Manifest-Version: 1.0
Dependencies: com.mycompany.configuration

我刚弄清楚问题。

如果我将我的 jboss-deployment-structure.xml 放在 WAR 的 WEB-INF 中,我必须指定并将我的依赖项放入其中。

如果我将 jboss-deployment-structure.xml 放在 EAR 的 META-INF 中,我必须指定并将依赖项放入其中。