简体   繁体   English

Maven 下载错误的传递依赖

[英]Maven downloads wrong transitive dependency

PROBLEM:问题:

Maven downloads wrong non-classifier transitive dependency. Maven 下载错误的非分类器传递依赖。

pom.xml pom.xml

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>19</version>
        <classifier>win</classifier>
    </dependency>
</dependencies>

This produces following result in dependencies:这会在依赖项中产生以下结果:

在此处输入图像描述

It is obviously wrong, because non-classifier javafx-base is empty and creates mess.这显然是错误的,因为非分类器 javafx-base 是空的并且会造成混乱。

WORKAROUND:解决方法:

It seems to be fixed when I excluse transitive dependency and manually declare javafx-base as dependency, like that:当我排除传递依赖并手动将 javafx-base 声明为依赖时,它似乎已修复,如下所示:

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>19</version>
        <classifier>win</classifier>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>19</version>
        <classifier>win</classifier>
        <exclusions>
            <exclusion>
                <groupId>*</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

In the result, I get this:结果,我得到了这个:

在此处输入图像描述

QUESTION:题:

Is there any solution to my problem that doesn't utilize some bad practice workaround?对于我的问题,是否有任何解决方案不使用一些不良做法的变通办法?

ADDITIONAL SOURCE:额外来源:

openjfx maven repository openjfx maven 存储库

Why do you think you have to explicitly mess around with the classifiers yourself?为什么你认为你必须自己明确地弄乱分类器? This is normally not needed at all.这通常根本不需要。 Just follow the examples given in the official documentation.只需按照官方文档中给出的示例进行操作即可。

https://openjfx.io/openjfx-docs/#maven https://openjfx.io/openjfx-docs/#maven

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM