简体   繁体   中英

JBoss AS 7 Module for Seam 2.3.0?

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.

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.

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

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:

     <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.

  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM