3.3. 更新 Fuse 项目的 Maven 依赖项
要为 Spring Boot 升级 Fuse 应用程序,请更新项目的 Maven 依赖项。
流程
-
打开项目的
pom.xml
文件。 在项目的
pom.xml
文件中添加dependencyManagement
元素(或者在父pom.xml
文件中),如下例所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意确保也更新 Spring Boot 版本。这通常在
pom.xml
文件中的 Fuse 版本下找到:<properties> <!-- configure the versions you want to use here --> <fuse.version>7.8.0.fuse-sb2-780038-redhat-00001</fuse.version> <spring-boot.version>2.3.4.RELEASE</spring-boot.version> </properties>
<properties> <!-- configure the versions you want to use here --> <fuse.version>7.8.0.fuse-sb2-780038-redhat-00001</fuse.version> <spring-boot.version>2.3.4.RELEASE</spring-boot.version> </properties>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
保存
pom.xml
文件。
在 pom.xml
文件中将 BOM 指定为依赖项后,可以在 pom.xml
文件中添加 Maven 依赖项,而无需 指定工件版本。例如,要为 camel-velocity
组件添加依赖项,您要将以下 XML 片段添加到 pom.xml
文件中的 dependencies
元素中:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-velocity</artifactId> <scope>provided</scope> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-velocity</artifactId>
<scope>provided</scope>
</dependency>
请注意,此依赖项定义中如何省略 version
元素。