Search code examples
eclipsemavenm2eclipsenexus

m2eclipse not showing latest artifacts in search


I am using Eclipse with the m2eclipse plugin and have setup a nexus repository mirror. When I search for artifacts it does not show the most recent versions; sometimes it shows very outdated versions of artifacts. I usually end up searching online for the latest version. Do I have something configured incorrectly, or is this a bug? I am currently on Eclipse Kepler, but this also happened in the Juno version.

For example, I tried adding the groovy dependency, which is currently on version 2.1.6. The latest (non-beta) shown is 1.8.1:

enter image description here

I don't think it has anything to do with Nexus. I can view my nexus repository in the Maven Repositories view in Eclipse. Also, if I manually type in the latest version there are not errors, so the JAR file(s) are pulled in correctly.

Here is my local settings.xml referencing the Nexus mirror:

<?xml version="1.0" encoding="UTF-8"?>
<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">

<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>       
    <server>
        <id>nexus</id>
        <username>deployment</username>
        <password>mypassword</password>
    </server>
</servers>

<mirrors>
    <mirror>
        <id>nexus</id>
        <mirrorOf>central</mirrorOf>
        <url>http://myserver/nexus/content/groups/public</url>
    </mirror>
</mirrors>
<profiles>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>

      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>nexus</activeProfile>
</activeProfiles>


Solution

  • This is most probably a problem with downloading the index files from Nexus.

    1. Make sure you can find the latest version of the dependency when searching in the Nexus web UI. If this doesn't work, then Nexus fails to download the indexes from the upstream sites. Check for errors in the logs and manually trigger the download.

    2. If the search on your Nexus works, make sure m2e can download the indexes when you start Eclipse. Look in the progress view when you start Eclipse; it should tell you that it downloads the indexes from Nexus.

    You can also have a look at the Maven Console (in your console view; enable DEBUG to see more) right after starting Eclipse.

    Lastly, you can start Eclipse with java instead of javaw. It will then print some debug information to a console/terminal window.