Maven Dependencies can't be resolved

白昼怎懂夜的黑 提交于 2019-12-03 12:01:07
yair

You should add those two plugins to your pom.

For cobertura, see this page.

For findbugs, see this page.

----- UPDATED -----

OK, I found the problem. It appears that you depend on jdom 1.1.2, which depends on jaxen 1.1.3 of which artifact is broken.

You can either try another jdom version or add to your pom the snapshot described in this site. Worked for me when I ran your pom on my PC. I copied the snapshot:

<dependency>
  <groupId>jaxen</groupId>
  <artifactId>jaxen</artifactId>
  <version>1.1.3</version>
  <!-- http://jira.codehaus.org/browse/JAXEN-217 -->
  <exclusions>
    <exclusion>
      <groupId>maven-plugins</groupId>
      <artifactId>maven-cobertura-plugin</artifactId>
    </exclusion>
    <exclusion>
      <groupId>maven-plugins</groupId>
      <artifactId>maven-findbugs-plugin</artifactId>
    </exclusion>
  </exclusions>
</dependency>
marfnk

For those who try to fix it with Ivy. This one worked for me:

<dependency org="jaxen" name="jaxen" rev="1.1.4"/>
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.4.1"/>
<dependency org="com.google.code.findbugs" name="findbugs" rev="2.0.1"/>
<dependency org="org.jdom" name="jdom" rev="2.0.2">
  <exclude module="jaxen"/>
  <exclude name="maven-cobertura-plugin"/>
  <exclude name="maven-findbugs-plugin"/>
</dependency>

Look in your local repository (normaly in <home>/.m2), where the artifacts should be. You'll find <artifactname>.lastUpdated files there. delete those and try again.

Possibly the artifacts failed to load due to network problems and now aren't even checked.

You can use the POM editor in Eclipse to see the dependency graph. It quickly showed my that jaxen-1.1.3 includes old maven1 dependencies. Eclipse even offers excluding them on the spot. Nice.

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