16.2. 配置应用程序以使用 Data Grid 模块
为 Red Hat JBoss EAP 安装 Data Grid 模块后,将您的应用程序配置为使用 Data Grid 功能。
流程
-
在项目
pom.xml
文件中,将所需的 Data Grid 依赖项标记为 提供。 -
配置您的工件存档器,以生成适当的
MANIFEST.MF
文件。
pom.xml
<dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-cachestore-jdbc</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <manifestEntries> <Dependencies>org.infinispan:rhdg-8.1 services</Dependencies> </manifestEntries> </archive> </configuration> </plugin> </plugins> </build>
Data Grid 功能被打包为一个模块 org.infinispan
,您可以将其作为条目添加到应用程序清单中,如下所示:
MANIFEST.MF
Manifest-Version: 1.0 Dependencies: org.infinispan:rhdg-8.1 services