搜索

第 1 章 将应用程序配置为使用 Eclipse Vert.x

download PDF

当您开始将应用程序配置为使用 Eclipse Vert.x 时,您必须在应用程序的根目录下的 pom.x BOM (Bill of Materials)构件中引用 Eclipse Vert. x BOM (Bill of Materials)构件。BOM 用于设置工件的正确版本。

前提条件

  • 基于 Maven 的应用程序

流程

  1. 打开 pom.xml 文件,将 io.vertx:vertx-dependencies 构件添加到 < dependencyManagement> 部分。将 类型指定为 pom范围 指定为 导入

    <project>
      ...
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-dependencies</artifactId>
            <version>${vertx.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>
      </dependencyManagement>
      ...
    </project>
  2. 包含以下属性来跟踪 Eclipse Vert.x 和 Eclipse Vert.x Maven 插件的版本。

    属性可用于设置在每个版本中更改的值。例如,产品或插件的版本。

    <project>
      ...
      <properties>
        <vertx.version>${vertx.version}</vertx.version>
        <vertx-maven-plugin.version>${vertx-maven-plugin.version}</vertx-maven-plugin.version>
      </properties>
      ...
    </project>
  3. 指定 vertx-maven-plugin 作为用于打包应用程序的插件:

    <project>
      ...
      <build>
        <plugins>
            ...
            <plugin>
                <groupId>io.reactiverse</groupId>
                <artifactId>vertx-maven-plugin</artifactId>
                <version>${vertx-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>vmp</id>
                        <goals>
                            <goal>initialize</goal>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <redeploy>true</redeploy>
                </configuration>
            </plugin>
            ...
        </plugins>
      </build>
      ...
    </project>
  4. 包含 软件仓库 和插件, 以指定包含工件和插件的存储库以构建应用程序:

    <project>
    ...
      <repositories>
        <repository>
          <id>redhat-ga</id>
          <name>Red Hat GA Repository</name>
          <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>redhat-ga</id>
          <name>Red Hat GA Repository</name>
          <url>https://maven.repository.redhat.com/ga/</url>
        </pluginRepository>
      </pluginRepositories>
    ...
    </project>

其他资源

  • 有关打包 Eclipse Vert.x 应用程序的更多信息,请参阅 Vert.x Maven 插件 文档。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.