28

I just downloaded and installed the "Eclipse IDE for Java EE Developers", a package solution coming with - among other plugins - the m2e plugin.

When trying to rebuild the index for the maven central repository within Eclipse, I get the following error:

"Unable to update index for central|http: //repo.maven.apache.org/maven2: [...]/.m2/repository/.cache/[...]/nexus-maven-repository-index.zip (Datei oder Verzeichnis nicht gefunden)"

Checking that cache, I find a file "nexus-maven-repository-index.gz", but no zip-file.

Did I miss some configuration option for the maven plugin?
If not, what is going wrong?
(At central.maven.org/maven2/.index/ there's only a gz-file. So why is m2e searching for a zip-file?)

Thank you very for your help much in advance.

Further details:

  1. Platform

    [alqais@kroete ~]$ uname --all
    Linux kroete 3.14.1-1-ARCH #1 SMP PREEMPT Mon Apr 14 21:01:08 CEST 2014 i686 GNU/Linux

  2. Eclipse-Version

    www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplersr2
    linux 32 bit: eclipse-jee-kepler-SR2-linux-gtk.tar.gz

  3. JRE

    www.java.com/en/download/linux_manual.jsp
    linux 32 bit: jre-7u55-linux-i586.tar.gz

  4. Eclipse Log (Console)

[alqais@kroete eclipse]$ ./eclipse -consoleLog
[...]
2014-04-25 00:39:42,681 [Worker-1] INFO o.e.m.c.i.i.nexus.NexusIndexManager - Updating index for repository: central|http: //repo.maven.apache.org/maven2
2014-04-25 00:39:42,889 [Worker-1] INFO c.n.h.c.p.n.NettyAsyncHttpProvider - Number of application's worked threads is 2
2014-04-25 00:41:48,619 [Worker-1] ERROR o.e.m.c.i.i.nexus.NexusIndexManager - Unable to update index for central|http: //repo.maven.apache.org/maven2: /home/alqais/.m2/repository/.cache/m2e/1.4.0/26522e0d83a422eed93329ece7565cfc/nexus-maven-repository-index.zip (Datei oder Verzeichnis nicht gefunden)
java.io.FileNotFoundException: /home/alqais/.m2/repository/.cache/m2e/1.4.0/26522e0d83a422eed93329ece7565cfc/nexus-maven-repository-index.zip (Datei oder Verzeichnis nicht gefunden)
at java.io.FileInputStream.open(Native Method) ~[na:1.7.0_55]
at java.io.FileInputStream.(Unknown Source) ~[na:1.7.0_55]
at org.apache.maven.index.updater.DefaultIndexUpdater$FileFetcher.retrieve(DefaultIndexUpdater.java:568) ~[indexer-core-3.1.0.jar:3.1.0]
at org.apache.maven.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:206) ~[indexer-core-3.1.0.jar:3.1.0]
at org.apache.maven.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:75) ~[indexer-core-3.1.0.jar:3.1.0]
at org.apache.maven.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:645) ~[indexer-core-3.1.0.jar:3.1.0]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:844) ~[indexer-core-3.1.0.jar:3.1.0]
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:156) ~[indexer-core-3.1.0.jar:3.1.0]
at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.updateRemoteIndex(NexusIndexManager.java:1139) [org.eclipse.m2e.core_1.4.0.20130601-0317.jar:na]
at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.updateIndex(NexusIndexManager.java:1086) [org.eclipse.m2e.core_1.4.0.20130601-0317.jar:na]
at org.eclipse.m2e.core.internal.index.nexus.NexusIndex.updateIndex(NexusIndex.java:145) [org.eclipse.m2e.core_1.4.0.20130601-0317.jar:na]
at org.eclipse.m2e.core.ui.internal.views.MavenRepositoryView$8$1.run(MavenRepositoryView.java:391) [org.eclipse.m2e.core.ui_1.4.0.20130601-0317.jar:na]
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) [org.eclipse.core.jobs_3.5.300.v20130429-1813.jar:na]
!SESSION 2014-04-25 00:36:18.506 -----------------------------------------------
eclipse.buildId=4.3.2.M20140221-1700
java.version=1.7.0_55
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product -consoleLog
!ENTRY org.eclipse.m2e.logback.appender 4 0 2014-04-25 00:41:48.640
!MESSAGE Unable to update index for central|http: //repo.maven.apache.org/maven2: /home/alqais/.m2/repository/.cache/m2e/1.4.0/26522e0d83a422eed93329ece7565cfc/nexus-maven-repository-index.zip (Datei oder Verzeichnis nicht gefunden)

  1. Eclipse process

[alqais@kroete ~]$ ps ax | grep jre
4337 pts/1 Sl+ 1:40 /home/alqais/programs/jre1.7.0_55/bin/java -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/alqais/programs/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar -os linux -ws gtk -arch x86 -showsplash /home/alqais/programs/eclipse//plugins/org.eclipse.platform_4.3.2.v20140221-1700/splash.bmp -launcher /home/alqais/programs/eclipse/eclipse -name Eclipse --launcher.library /home/alqais/programs/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20140116-2212/eclipse_1508.so -startup /home/alqais/programs/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar --launcher.appendVmargs -exitdata 4e0008 -product org.eclipse.epp.package.jee.product -consoleLog -vm /home/alqais/programs/jre1.7.0_55/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/alqais/programs/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar

  1. local maven cache content

[alqais@kroete ~]$ ls -alt .m2/repository/.cache/m2e/1.4.0/26522e0d83a422eed93329ece7565cfc/
insgesamt 116896
drwxr-xr-x 2 alqais alqais 4096 25. Apr 00:40 min
drwxr-xr-x 3 alqais alqais 4096 25. Apr 00:40 .
-rw-r--r-- 1 alqais alqais 1131 25. Apr 00:40 nexus-maven-repository-index.properties
-rw-r--r-- 1 alqais alqais 0 25. Apr 00:40 chunks.lst
-rw-r--r-- 1 alqais alqais 119684538 25. Apr 00:40 nexus-maven-repository-index.gz
-rw-r--r-- 1 alqais alqais 0 24. Apr 23:51 .lock
drwxr-xr-x 3 alqais alqais 4096 24. Apr 23:51 ..

Hello_world
  • 303
  • 2
  • 11
alqais
  • 289
  • 3
  • 3
  • possible duplicate of [Classic error: Unable to update index for central|http://repo1.maven.org/maven2](http://stackoverflow.com/questions/7065478/classic-error-unable-to-update-index-for-centralhttp-repo1-maven-org-maven2) – Joe Apr 26 '14 at 14:27
  • Hi @Joe, I honestly could not figure out, in what way my question should be a duplicate of [http://stackoverflow.com/questions/7065478/classic-error-unable-to-update-index-for-centralhttp-repo1-maven-org-maven2]. I found that the zip-format of the index is a "legacy" format http://stackoverflow.com/questions/5776519/how-to-parse-maven-repository-indexes-generated-by-nexus. So obviously the m2e-plugin is expecting something which http:/repo.maven.apache.org/maven2 does not offer (there is only .gz). So how could I tell m2e to work with the really existing gz-file? – alqais May 02 '14 at 16:13
  • Is any workaround known for this one? – Boris Brodski Dec 15 '15 at 19:35
  • Kepler is a little bit deprecated ... – biology.info Oct 13 '16 at 11:08
  • Yeah current version is Eclipse Neon, and between Neon and Kepler (first release mid 2013), there was Mars and Luna. – Tristan Apr 06 '17 at 19:31

3 Answers3

0

What you can try in order to separate the potential Eclipse problem from the Maven problem is to install the latest version of Maven and set it up into Eclipse (Windows > preferences > Maven).

Tristan
  • 8,733
  • 7
  • 48
  • 96
0

Looks like in that version of maven-indexer, if there's any problem reading the .gz index it'll silently fail over to trying a legacy index .zip, swallowing any error message associated with the .gz. Here's the relevant bit of code from maven-indexer:

try
{
    Date timestamp = target.setIndexFile( source, IndexingContext.INDEX_FILE + ".gz" );
    if ( source instanceof LocalIndexCacheFetcher )
    {
        // local cache has inverse organization compared to remote indexes,
        // i.e. initial index file and delta chunks to apply on top of it
        for ( String filename : ( (LocalIndexCacheFetcher) source ).getChunks() )
        {
            target.addIndexChunk( source, filename );
        }
    }
    return timestamp;
}
catch ( IOException ex )
{
    // try to look for legacy index transfer format
    return target.setIndexFile( source, IndexingContext.INDEX_FILE + ".zip" );
}

I'd try deleting (or renaming) nexus-maven-repository-index.gz and trying to re-index in the Maven settings for Eclipse, which will hopefully persuade Eclipse to recreate a good index.gz file.

Stewart Francis
  • 735
  • 5
  • 10
0

Look into settings.xml for p2 repo mirror entries.

This happens when eclipse try to download .gz from repo defined in settings.xml and it fails so it will write html 404 response as .gz file to disk and you got stuck.

I found only one solution

WORKAROUND: - Go to the "maven repository" view and disable indexing for all your p2 repositories - Restart Eclipse

Unfortunately starting Eclipse with a fresh workspace my ruin your .m2/.cache directory, so you will have to redo the workaround from above.

Please update solution if you already found one.

positivecrux
  • 1,307
  • 2
  • 16
  • 35