为什么Maven无法解析或收集以下依赖项:org.eclipse.egit:org.eclipse.egit.gitflow:jar:51.202007141445-r

问题描述

为什么将以下依赖项添加到我的项目中时,为什么会出现上述错误:

<dependency>
    <groupId>org.eclipse.egit</groupId>
    <artifactId>org.eclipse.egit.gitflow</artifactId>
    <version>5.8.1.202007141445-r</version>
</dependency>

> [ERROR] Failed to execute goal on project myproject: Could not resolve
> dependencies for project
> com.example:myproject:maven-plugin:0.0.1-SNAPSHOT: Failure to find
> org.eclipse.egit:org.eclipse.egit.gitflow:jar:51.202007141445-r 
>[ERROR]
>[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
>[ERROR] Re-run Maven using the -X switch to enable full debug logging.
>[ERROR]
>[ERROR] For more information about the errors and possible solutions,please 
> read the following articles:
>[ERROR] [Help 1]
>http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

依赖项确实存在:https://mvnrepository.com/artifact/org.eclipse.egit/org.eclipse.egit.gitflow/5.8.1.202007141445-r

解决方法

默认的Maven Central中不存在依赖项,它是Eclipse Public Repository的一部分。具体在这里:

https://repo.eclipse.org/content/groups/releases/org/eclipse/egit/org.eclipse.egit.gitflow/5.8.1.202007141445-r/

尝试添加:

    <repositories>
        <repository>
            <id>epl</id>
            <url>https://repo.eclipse.org/content/groups/releases</url>
        </repository>
    </repositories>

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...