13.2. 配置应用程序以使用数据网格模块
安装红帽 JBoss EAP 的数据网格模块后,将您的应用程序配置为使用 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.4 services</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
数据网格功能打包为单个模块 org.infinispan,您可以将其作为条目添加到应用程序清单中,如下所示:
MANIFEST.MF
Manifest-Version: 1.0
Dependencies: org.infinispan:rhdg-8.4 services
AWS 依赖项
如果您需要 AWS 依赖项,如 S3_PING,请在应用程序清单中添加以下模块:
Manifest-Version: 1.0
Dependencies: com.amazonaws.aws-java-sdk:rhdg-8.4 services