繁体   English   中英

pom.xml中的错误-无法传输org.jacoco jacoco-maven-plugin

[英]Error in pom.xml - Failure to transfer org.jacoco jacoco-maven-plugin

我有一个不同的父项目,现在出现以下错误:

无法从http://repo.maven.apache.org/maven2传输org.jacoco:jacoco-maven-plugin:pom:0.6.2.201302030002缓存在本地存储库中,直到中心的更新间隔重新尝试解析已过去或强制进行更新。 原始错误:无法将工件org.jacoco:jacoco-maven-plugin:pom:0.6.2.201302030002从中央传输到中央(http:// repo.maven.apache.org/maven2):null到http:// repo。 maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/ 0.6.2.201302030002 / jacoco-行家-插件-0.6.2.201302030002.pom

我用0.5.7.201204190339和0.6.2.201302030002和$ {jacoco.version}进行了尝试。 但是现在成功了:-(

我使用Spring Tool Suite-版本:3.6.0.RELEASE并安装了m2eclipse插件。

<build>
    <defaultGoal>install</defaultGoal>
    <plugins>
        <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <!-- <version>${jacoco.version}</version>  -->
              <version>0.5.7.201204190339</version>
              <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <skip>${jacoco.skip}</skip>
            </configuration>
        </plugin>

如果您位于公司防火墙或其他代理之后,则需要创建settings.xml文件并为代理服务器指定凭据,如下所示。

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <proxies>
        <proxy>
            <id>my_proxy</id>
            <active>true</active>
            <protocol>http</protocol>
            <host>{proxy server address}</host>
            <port>{proxy server port}</port>
            <username>{user name to be used for proxy}</username>
            <password>{password to be used for proxy}</password>
            <nonProxyHosts>*.google.com|localhost|127.0.0.1</nonProxyHosts>
        </proxy>
    </proxies>
</settings>

您可能尝试的另一件事是删除存储库目录,然后重试。

如果使用的是eclipse,则还需要在Eclipse中配置代理设置。 转到窗口->首选项->在搜索框中输入“代理”。

在“ Network connections ,选择“活动提供者”作为“ Manual ,然后为HTTP和HTTPS设置代理设置。 不要为SOCKS设置代理。

这些解决方案之一始终对我有用:)

暂无
暂无

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

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