PROBLEM:
Maven downloads wrong non-classifier transitive dependency.
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.
WORKAROUND:
It seems to be fixed when I excluse transitive dependency and manually declare javafx-base as dependency, like that:
<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:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.