代码之家  ›  专栏  ›  技术社区  ›  Andres Urrego Angel

maven问题验证依赖关系:beam-sdks-java-io-google云平台

  •  0
  • Andres Urrego Angel  · 技术社区  · 6 年前

    我需要在我的maven项目中集成这个依赖项:

      <!-- https://mvnrepository.com/artifact/org.apache.beam/beam-sdks-java-io-google-cloud-platform -->
            <dependency>
                <groupId>org.apache.beam</groupId>
                <artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
                <version>2.11.0</version>
            </dependency>
    

    但是,当我尝试执行命令时 mvn verify 在我的项目中,我得到了附加的错误:

    enter image description here

    谢谢你的帮助!

    更新

    我包括了我的公共从属关系,比如:

    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-pubsub</artifactId>
        <version>1.69.0</version>
            <exclusions>
                <exclusion>
                    <groupId>io.grpc</groupId>
                    <artifactId>grpc-core</artifactId>
                </exclusion>
            </exclusions>
    </dependency>
    

    可惜beam提供的功能不适合我的项目。

    0 回复  |  直到 6 年前
        1
  •  2
  •   Andrew Pilloud    6 年前

    你所描述的是 Diamond Dependency problem 是的。

    如果可以使用与beam相同版本的pubsub,则不应发生此冲突。根据Maven Central, beam-sdks-java-io-google-cloud-platform 取决于grpc-google-cloud-pubsub-v1.43.0。

        2
  •  0
  •   Andres Urrego Angel    6 年前

    我已经明白了重点是 pom.xml 依赖关系:

    <!--        <dependency>-->
    <!--            <groupId>com.google.cloud</groupId>-->
    <!--            <artifactId>google-cloud-pubsub</artifactId>-->
    <!--            <version>1.66.0</version>-->
    <!--        </dependency>-->
    

    但是如果我需要在同一个项目上处理这两个依赖项,我应该怎么做呢?