gpt4 book ai didi

java - 有没有办法替换以前由 pyx4me.com 托管的 Maven 依赖项?

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

我正在尝试构建一个使用 Maven 作为构建工具的大型 Java 代码库。但是,构建(mvn clean install -DskipTests)始终会导致以下错误:

[ERROR] Failed to execute goal com.pyx4j:maven-junction-plugin:1.0.3:unlink (unlink) on project flink-dist_2.10:  Execution unlink of goal com.pyx4j:maven-junction-plugin:1.0.3:unlink failed: Plugin com.pyx4j:maven-junction-plugin:1.0.3 or one of its dependencies could not be resolved: Failed to collect dependencies for com.pyx4j:maven-junction-plugin:jar:1.0.3 (): Failed to read artifact descriptor for sysinternals:junction:exe:1.04: Could not transfer artifact sysinternals:junction:pom:1.04 from/to pyx4me-web (http://www.pyx4me.com/maven2): Connection to http://www.pyx4me.com refused: Connection refused (Connection refused) -> [Help 1]

我对maven一无所知,所以我有点不知道该做什么。

我尝试在本地 .m2 目录中手动安装 maven-junction-plugin 。然而,在那之前我才明白,这不是缺少 .jar,而是缺少该 jar 的某些依赖项。

对于了解 Maven 的人提供的任何提示或见解,我将非常感激。

最佳答案

您遇到的问题如下:尽管 maven-junction-plugin Artifact 版本 1.0.3 在 maven 中央存储库中可用,但它会尝试下载名为 sysinternals:junction:exe 的依赖项: 1.04 来自 ( http://www.pyx4me.com/maven2 ),但连接超时(您也可以尝试 ping pyx4me.com,您会发现它没有响应)。

maven-junction-plugin 在 1.2 版本之前已被 Apache Flink 使用。Apache Flink 当前的稳定版本不再使用它。事实上,该项目似乎已被放弃并且不再受支持。

请参阅以下maven's central Jira ticket要求将其从 Maven Central 中删除。

所以看起来没有简单的方法可以完成您想要做的事情。但你也许可以绕过它。

首先看起来 systinternal:junction:1.04 在任何地方都不可用,但 1.07 版本可用 here (它可能与 maven-junction-plugin 1.04 不兼容,因此您需要对其进行足够的测试以确保它是兼容的)

该 zip 包含两种版本的 .exe(32 位版本和 64 位版本)。使用适合您需要的版本并将其安装在本地存储库中。

在本地存储库中安装 Artifact 的一般方法是描述的方法 here ,但由于我们正在处理 .exe 文件,您宁愿使用描述的过程 here

现在假设您已在本地存储库中成功安装了 systinernal:junction:1.07,并具有以下 Artifact 属性:

  • groupId:您的组 ID
  • artifactId:路口
  • 版本:1.07
  • 类型:exe

您可以使用jar installation in local repository安装插件的 jar 以及 pom 的自定义版本的方法,其中您指向 systinternal:junction 依赖项的本地版本而不是原始版本。您可以找到这两个文件 here .

自定义 pom 的依赖项部分将如下所示:

<dependencies>
<dependency>
<groupId>your-group-id</groupId>
<artifactId>junction</artifactId>
<version>1.07</version>
<type>exe</type>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>

您可以删除旧的存储库部分,因为远程存储库无论如何都无法工作。

在我看来,这太过于黑客了(而且你可能很难说服你的同事在生产中引入这样的东西)。因此,我建议尝试找到与您使用此插件相同的功能。

关于java - 有没有办法替换以前由 pyx4me.com 托管的 Maven 依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59614292/

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