Problem with m2eclipse -- unable to download maven artifacts from Archiva -- get .lastUpdated files instead
I'm using STS 2.5.2 based on Eclipse 3.6 (Helios) with built-in m2eclipse 0.10.0. I'm also using Archiva as my "remote" repository manager (it's hosted on the same machine).
I've changed my Maven 开发者_JAVA百科config settings file to specify my Archiva instance as a mirror of *, and Archiva is also a proxy of Central. In all of my pom's I've specified my Archiva internal repository as both a repository and a plug-in repository.
The setup is such that when Maven command line (CLI) requests an artifact, for example junit:junit:3.8.1:jar, the request goes to Archiva, which in turn retrieves the artifact from Central if it doesn't already have it, then serves it to Maven CLI.
This all works fine for Maven CLI. My problem is that when building my project from Eclipse, m2eclipse is unable to download certain artifacts from Archiva. Instead, I get the dreaded .lastUpdated files (pom and jar) only. Even though the artifacts are in Archiva. This error doesn't happen for the majority of artifacts, just certain artifacts in Archiva, for example org.apache.maven.doxia:doxia-sink-api:1.0-alpha-9:jar, which is a dependency on one of my project dependencies. I've tried removing the offending artifacts from Archiva, deleting my .m2 repository, and rebuilding, but the problem persists.
Any ideas? Is this a documented m2eclipse bug? As a workaround, I've created a special sub-module that does nothing but downloads the missing artifacts from Archive from Maven CLI.
Thanks in advance,
Steve Solomon
I use artifactory and received the .lastUpdated file when the wrong URL was specified. To troubleshoot this I ran mvn with the -X option and saw that it was not downloading the jar from the repository I was expecting to be downloaded from.
I'm guessing you would also have problems if you specified an incorrect artifact, weather it be the name or the version.
The best thing to do in this scenario would be to delete artifacts which have .lastUpdated appended to it. And run mvn -U (force update switch -U )
精彩评论