Quarkus 项目

Quarkus project

当我尝试创建新的 Quarkus 项目和 select 一些扩展时出现错误。但是当创建项目时,我在创建项目期间 selected 的每个扩展中都会收到此错误。

<dependencies>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-hibernate-orm</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-smallrye-reactive-messaging-amqp</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-narayana-jta</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy-jackson</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-arc</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-resteasy</artifactId>
    </dependency>
    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-junit5</artifactId>
        <scope>test</scope>
    </dependency>

都是同样的错误:

Multiple annotations found at this line:

  • Project build error: 'dependencies.dependency.version' for io.quarkus:quarkus-hibernate-orm:jar is missing.
  • 'dependencies.dependency.version' for io.quarkus:quarkus-hibernate-orm:jar is missing.

看起来您缺少 Quarkus BOM,允许您省略不同 Quarkus 依赖项的版本。

看看getting started guide

看起来像这样

    <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-universe-bom</artifactId>
        <version>${quarkus.platform.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>

我刚刚解决了问题.. 运行命令

mvn clean install -U

谢谢