gpt4 book ai didi

java - Maven - 在 mac 上下载 win 依赖项

转载 作者:行者123 更新时间:2023-12-01 17:00:02 25 4
gpt4 key购买 nike

我目前正在使用 maven 开发 Openjfx 项目(适用于 Windows),因此我的 POM 中有:

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12.0.2</version>
</dependency>

由于流行病,我不得不出差,但我被困在另一个城市,只有我的 MacBook。

我被要求对项目进行一些更改。现在我想生成带有 Windows 依赖项的 jar,但 maven 仅下载 mac 版本。

javafx-controls-12.0.2-mac.jar
javafx-graphics-12.0.2-mac.jar
javafx-base-12.0.2-mac.jar
javafx-fxml-12.0.2-mac.jar

有没有办法在mac中强制下载win版本的文件?

PS:我还使用 Apache Maven Shade 插件将 Openjfx 文件打包到 jar 中。

最佳答案

刚刚发现可以指定下载jar包的平台,使其跨平台如下(根据 https://openjfx.io/openjfx-docs/#modular ):

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

关于java - Maven - 在 mac 上下载 win 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61522904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com