maven not able to download jacoco 0.7.10-SNAPSHOT jar

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 10:47:08

问题


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>

And this my repository section

<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>

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

[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]

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. Please pardon me if this is already answered somewhere. I haven't been able to find a solution yet.


回答1:


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

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


来源:https://stackoverflow.com/questions/46681811/maven-not-able-to-download-jacoco-0-7-10-snapshot-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!