适用于Seam 2.3.0的JBoss AS 7模块?

时间:2021-10-30 19:58:18

I have become a big fan of JBoss AS7's module mechanism for specifying dependencies within an application. It has drastically reduced the size of the EAR files we deploy, and has made it very easy for us to deploy multiple applications that have the same dependencies. Up until this point, however, the modules we have created ourselves have been very small and simple. Now, however, we'd like to use a JBoss module for JBoss Seam 2.3.0.

我已成为JBoss AS7模块机制的忠实粉丝,用于指定应用程序中的依赖项。它大大减少了我们部署的EAR文件的大小,并使我们很容易部署具有相同依赖关系的多个应用程序。然而,到目前为止,我们自己创建的模块非常小而且简单。但是,现在我们想将JBoss模块用于JBoss Seam 2.3.0。

Does anyone know of a resource that would explain how best we can do that? Seam is a huge framework, with lots of dependencies of its own. Up to this point, we've been putting the JARs directly within the EAR/WAR files. We'd like to get away from that. Can anyone give any help on how to create a JBoss AS7 module for Seam 2.3.0 correctly? By correctly, I mean referencing the additional modules within JBoss correctly, segmenting properly, etc.

有没有人知道可以解释我们如何做到最好的资源? Seam是一个庞大的框架,拥有许多自己的依赖关系。到目前为止,我们一直将JAR直接放在EAR / WAR文件中。我们想摆脱这种局面。任何人都可以提供有关如何正确创建Seam 2.3.0的JBoss AS7模块的帮助吗?正确地说,我的意思是正确引用JBoss中的附加模块,正确分段等。

Any advice or guidance you can give would be greatly appreciated. Thanks in advance!

您将给予的任何建议或指导将不胜感激。提前致谢!

1 个解决方案

#1


0  

You will need to do this in three steps:

您需要分三步完成:

  1. Use a build automation tool like Maven and include the following to declare run-time dependencies:

    使用像Maven这样的构建自动化工具,并包含以下内容来声明运行时依赖项:

    <build>
      <plugins>
        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-war-plugin</artifactId>
           <version>2.1.1</version>
           <configuration>
             <archive>
               <manifestEntries>
                 <Dependencies>org.slf4j,org.apache.httpcomponents</Dependencies>
               </manifestEntries>
             </archive>
    
  2. The dependencies entered like this will provide visibility of the modules available within JBoss 7.1 so that you can exclude them from your war packaging. You would still need them at compile time, so you can set their scope to provided - Maven will automatically not package them.

    像这样输入的依赖项将提供JBoss 7.1中可用模块的可见性,以便您可以将它们从war包装中排除。您仍然需要在编译时使用它们,因此您可以将其范围设置为提供 - Maven将自动不打包它们。

  3. I would not add any custom modules to JBoss, but if you want that type of architecture then you would need to create new modules or different versions of existing modules to satisfy your dependencies and then include them in the manifest entries above.

    我不会向JBoss添加任何自定义模块,但如果您需要这种类型的体系结构,那么您需要创建新模块或现有模块的不同版本以满足您的依赖关系,然后将它们包含在上面的清单条目中。

#1


0  

You will need to do this in three steps:

您需要分三步完成:

  1. Use a build automation tool like Maven and include the following to declare run-time dependencies:

    使用像Maven这样的构建自动化工具,并包含以下内容来声明运行时依赖项:

    <build>
      <plugins>
        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-war-plugin</artifactId>
           <version>2.1.1</version>
           <configuration>
             <archive>
               <manifestEntries>
                 <Dependencies>org.slf4j,org.apache.httpcomponents</Dependencies>
               </manifestEntries>
             </archive>
    
  2. The dependencies entered like this will provide visibility of the modules available within JBoss 7.1 so that you can exclude them from your war packaging. You would still need them at compile time, so you can set their scope to provided - Maven will automatically not package them.

    像这样输入的依赖项将提供JBoss 7.1中可用模块的可见性,以便您可以将它们从war包装中排除。您仍然需要在编译时使用它们,因此您可以将其范围设置为提供 - Maven将自动不打包它们。

  3. I would not add any custom modules to JBoss, but if you want that type of architecture then you would need to create new modules or different versions of existing modules to satisfy your dependencies and then include them in the manifest entries above.

    我不会向JBoss添加任何自定义模块,但如果您需要这种类型的体系结构,那么您需要创建新模块或现有模块的不同版本以满足您的依赖关系,然后将它们包含在上面的清单条目中。