maven无法下载jacoco 0.7.10-SNAPSHOT jar [英] maven not able to download jacoco 0.7.10-SNAPSHOT jar

查看:513
本文介绍了maven无法下载jacoco 0.7.10-SNAPSHOT jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此感到困惑.我的pom.xml中有这个

I am puzzled by this. I have this in my pom.xml

<build>
    <pluginManagement>
        ... other plugins ...
        <plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
           <version>0.7.10-SNAPSHOT</version>
        </plugin>
    </pluginManagement>
</build>

这是我的存储库部分

<repositories>
    <repository>
        <id>oss-sonatype</id>
        <name>oss-sonatype</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <updatePolicy>daily</updatePolicy>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    ..... other repositories ....        
</repositories>

据我所知,jacoco-0.7.10-SNAPSHOT存在于

As far as i can find out the jacoco-0.7.10-SNAPSHOT is present at https://oss.sonatype.org/content/repositories/snapshots/org/jacoco/jacoco-maven-plugin/0.7.10-SNAPSHOT/

我的理解是应该下载它并且构建应该成功,但是出现以下错误

My understanding is that it should be downloaded and build should succeed but i get the following error

[错误]插件org.jacoco:jacoco-maven-plugin:0.7.10-SNAPSHOT或其依赖项之一无法解析:找不到工件org.jacoco:jacoco-maven-插件:jar:0.7.10-SNAPSHOT-> [帮助1]

[ERROR] Plugin org.jacoco:jacoco-maven-plugin:0.7.10-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.jacoco:jacoco-maven-plugin:jar:0.7.10-SNAPSHOT -> [Help 1]

我看到了一个解决方案,人们建议将存储库添加到〜/.m2/settings.xml文件中. 我想知道是否可以在不更改.m2/settings.xml的情况下执行此操作,为什么当前设置无法正常工作.任何提示,不胜感激.

I saw solution where people suggested to add the repository in ~/.m2/settings.xml file. I want to know can i do this without changing the .m2/settings.xml and why is the current setup not working. Any tips are greatly appreciated.

P.S.如果这已经在某处得到回答,请原谅我.我还没有找到解决方案.

P.S. Please pardon me if this is already answered somewhere. I haven't been able to find a solution yet.

推荐答案

normal 存储库和 plugin 存储库之间进行Maven区分.您必须使用

定义插件存储库

Maven distincs between normal repositories and plugin repositories. You have to define the plugin repositories with

<pluginRepositories>
   <pluginRepository>
      ...
   </pluginRepository>
</pluginRepositories>

这篇关于maven无法下载jacoco 0.7.10-SNAPSHOT jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆