代码之家  ›  专栏  ›  技术社区  ›  Manoj

如何将文件夹添加到JBOSS EAP 6 Classpath

  •  0
  • Manoj  · 技术社区  · 9 年前

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

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

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

    Jboss文件夹结构:

    enter image description here

    2 回复  |  直到 9 年前
        1
  •  1
  •   Federico Sierra    9 年前

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

    jboss-deployment-structure.xml 文件

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

    此文件必须放在 META-INF 您的目录 EAR文件或 WEB-INF WAR文件的目录。看见 Class Loading in AS7 了解更多信息。

    或者使用 MANIFEST.MF 条目:

    Manifest-Version: 1.0
    Dependencies: com.mycompany.configuration
    
        2
  •  0
  •   Manoj    9 年前

    我只是想清楚问题所在。

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

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