简体   繁体   中英

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

I have a parent project with different and now I get the following error:

Failure to transfer org.jacoco:jacoco-maven-plugin:pom:0.6.2.201302030002 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.jacoco:jacoco-maven-plugin:pom:0.6.2.201302030002 from/to central (http:// repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/ 0.6.2.201302030002/jacoco-maven-plugin-0.6.2.201302030002.pom

I tried it with 0.5.7.201204190339 AND 0.6.2.201302030002 and ${jacoco.version} . But now success :-(

I use Spring Tool Suite - Version: 3.6.0.RELEASE and I have installed m2eclipse Plugin.

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

If you are behind corporate firewall or other proxy then you need to create settings.xml file and specify credentials for proxy server like below.

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

Other thing you may try is to delete repository directory and try again.

If you are using eclipse then you need to configure proxy settings in Eclipse too. Goto Window -> Preference -> type 'proxy' in search box.

In Network connections , choose 'Active Provider' as Manual and then set proxy settings for HTTP and HTTPS. Do not set proxy for SOCKS.

One of these solutions always work for me :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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