3

I have a Maven project in Eclipse and if I try to run Maven > Update project I get the following error

Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 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.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): java.net.ConnectException: connection timed out to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom

  • I tried to run Maven with the embedded installation and an external one - same result.
  • I don't have any proxy set up in Eclipse and I don't need one.
  • I do not reference the plugin in my POM.
  • Running mvn eclipse:eclipse in console works perfectly.
  • I'm using Eclipse Kepler and m2e 1.4.0.201.

The parent POM is

<parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
</parent>

Anyone have any idea why?

erip
  • 16,374
  • 11
  • 66
  • 121
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
  • *You* may not be referencing the plugin, but the super POM might. I'm unclear whether you're saying if you tried this on the command-line and whether that worked or not? If you state: "don't need" "any proxy set up", do you mean that your computer has unrestricted access to the Internet? – Sander Verhagen Sep 27 '13 at 23:06
  • The command line mvn eclipse:eclipse works perfectly. The computer has unrestricted access to Internet and all the sites are working in all browsers without a proxy. – Adrian Ber Sep 28 '13 at 22:10

2 Answers2

5

Adding

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
        </plugin>
    </plugins>
</pluginManagement>

solved the problem.

Sander Verhagen
  • 8,540
  • 4
  • 41
  • 63
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
  • I don't understand why - but it also solved my problem. Does anybody have an explaination for this behaviour? – Del Pedro Jun 12 '14 at 07:57
  • solved my problem too! I dont have any idea why... thanks! But i would like to unterstand why.. would be great if anyone could explain that – ZelelB Jul 29 '14 at 08:50
0

Here's the error I was getting initially:

Failure to transfer org.sonatype.oss:oss-parent:pom:9 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.sonatype.oss:oss-parent:pom:9 from/to central (http://repo.maven.apache.org/maven2): Address family not supported by protocol family: connect

I didn't need to introduce any additional maven plugins, simply enclosing the existing plugins inside <pluginManagement> tag as described here: How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds solved it for me - hopefully it will help someone else as well.

Community
  • 1
  • 1
Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82