简体   繁体   English

常春藤无法解决Maven-cobertura-plugin

[英]Ivy cannot resolve maven-cobertura-plugin

I am using Ivy for dependency managment. 我正在使用常春藤进行依赖性管理。

I have problems with 我有问题

  • maven-findbgs-plugin:plugin:1.3.1 maven-findbgs-plugin:插件:1.3.1
    • maven-cobertura-plugin:plugin:1.3 maven-cobertura-plugin:插件:1.3

There were several topics on SO about this:eg Maven Dependencies can't be resolved SO有几个与此相关的主题:例如, 无法解决Maven依赖关系

The answer is to exclude jaxen: 答案是排除jaxen:

    <dependency org="org.jdom" name="jdom" rev="2.0.2">
        <exclude module="jaxen"/>
    </dependency>

I tried to exclude these dependencies, but then got another problem: 我试图排除这些依赖关系,但是又遇到了另一个问题:

unresolved dependency: asm#asm;2.0: java.text.ParseException: inconsistent module descriptor file found in 'http://repo1.maven.org/maven2/asm/asm/2.0/asm-2.0.pom': bad revision: expected='2.0' found='@product.version@';

Here is ivy.xml: 这是ivy.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">

    <info
        organisation="organisation"
        module="module"
        status="integration">
    </info>

    <dependencies>
        <dependency org="dom4j" name="dom4j" rev="1.6.1"/>

        <dependency org="org.jdom" name="jdom" rev="2.0.2">
            <exclude module="jaxen"/>
        </dependency>

        <dependency org="org.apache.poi" name="poi" rev="3.8"/> 
        <dependency org="org.apache.poi" name="poi-ooxml" rev="3.8"/>
        <dependency org="org.apache.poi" name="ooxml-schemas" rev="1.1"/>
        <dependency org="junit" name="junit" rev="4.10"/>
        <dependency org="org.mockito" name="mockito-all" rev="1.9.0"/>
        <dependency org="maven-plugins" name="maven-cobertura-plugin" rev="1.1" />
    </dependencies>

</ivy-module>

What should I to do? 我该怎么办?

First I see that you are using a really old version of maven-cobertura-plugin (1.3) the current version is 2.5.1. 首先,我看到您使用的是maven-cobertura-plugin (1.3)的真正旧版本,当前版本为2.5.1。
Furthermore the pom you are accessing is one of those artifacts in Maven Central which are simply of bad quality which means in this case simply unusable. 此外,您要访问的pom是Maven Central中的那些工件之一,它们的质量很差,这意味着在这种情况下根本无法使用。
The maven-findbugs-plugin you are referencing is also really old. 您所引用的maven-findbugs-plugins也确实很旧。 Current version is 2.5.2 in contradiction to 1.3.1 which you are using. 当前版本是2.5.2,与您使用的1.3.1背道而驰。
What I don't understand is why are you trying to resolve Maven Plugins because you are running Ivy and following from that you are using Ant. 我不明白的是,为什么要尝试解析Maven插件,因为您正在运行Ivy,并且随后又在使用Ant。

Here is working ivy.xml 这里正在工作ivy.xml

<ivy-module version="2.0">
    <info organisation="it.cup2000" module="sar"/>
    <configurations defaultconfmapping="runtime->*">
        <conf name="runtime" />
        <conf name="compile" extends="runtime"/>
        <conf name="test" extends="compile"/>
    </configurations>       
    <dependencies>
        <dependency org="org.jdom" name="jdom2" rev="2.0.3"/>
        <exclude org="maven-plugins" module="maven-cobertura-plugin"/>
        <exclude org="maven-plugins" module="maven-findbugs-plugin"/>
    </dependencies>
</ivy-module>

The jdom2 dependency triggers the problem and the two exclude fix it jdom2依赖项会触发问题,而两者会排除此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM