搜索

5.3. 更新 Fuse 项目的 Maven 依赖项

download PDF

要升级 Spring Boot 的 Fuse 应用程序,请更新项目的 Maven 依赖项。

流程

  1. 打开项目的 pom.xml 文件。
  2. 在项目的 pom.xml 文件中添加 dependencies Management 元素(或者,可能在父 pom.xml 文件中),如下例所示:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <project ...>
      ...
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
        <!-- configure the versions you want to use here -->
        <fuse.version>7.13.0.fuse-7_13_0-00012-redhat-00001</fuse.version>
    
      </properties>
    
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.jboss.redhat-fuse</groupId>
            <artifactId>fuse-springboot-bom</artifactId>
            <version>${fuse.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>
      </dependencyManagement>
      ...
    </project>
    注意

    确保也更新您的 Spring Boot 版本。这通常位于 pom.xml 文件中的 Fuse 版本下:

         <properties>
          <!-- configure the versions you want to use here -->
          <fuse.version>7.13.0.fuse-7_13_0-00012-redhat-00001</fuse.version>
          <spring-boot.version>2.7.18</spring-boot.version>
        </properties>
  3. 保存 pom.xml 文件。

在将 BOM 指定为 pom.xml 文件中的依赖项后,可以在没有指定工件版本 的情况下将 Maven 依赖项添加到 pom.xml 文件中。例如,要为 camel-velocity 组件添加依赖项,您可以在 pom.xml 文件中的 dependencies 元素中添加以下 XML 片段:

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-velocity</artifactId>
  <scope>provided</scope>
</dependency>

注意如何在这个依赖项定义中省略 version 元素。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.