Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353478

Summary: Unable to update / create index for repository central
Product: z_Archived Reporter: Markus Liebelt <markus.liebelt>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Console output from running an eclipse application that updates the index for Maven Central.
none
Archive of log from timeout in update index with configuration of eclipse and logback feature none

Description Markus Liebelt CLA 2011-08-01 02:43:42 EDT
Created attachment 200640 [details]
Console output from running an eclipse application that updates the index for Maven Central.

I'm using the Indigo build, and face a critical problem. When I try to create a new Maven2 project from scratch, m2e starts to update the nexus index for http://repo1.maven.org/maven2, and stops then after a timeout. I think the problem is related to the proxy I have to use in our corporate environment. I checked the same installation at home (without a proxy), and the update starts immediately and succeeds after a while.

To trace down the problem, I have downloaded the full build for Indigo, and started inside a new workspace an eclipse application with all plugins enabled. I repeated then the process in creating a new maven2 project, and got now some debug output and stacktraces in the console window.

Is there anything I can do further to trace the problem? At the moment, the index for Maven Central does not work, so people won't find the information about their libraries and versions they want to use. The feedback in our company is, that m2e is pretty useless for them.

In the console output, I find a timeout after the request for http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
When I do a request through the browser, this results in a 302 and after that the real request to http://mirrors.ibiblio.org/pub/mirrors/maven2/dot-index/nexus-maven-repository-index.properties which works well. I use the same proxy in the browser and in eclipse.

I have appended the console output as attachment.
Comment 1 Igor Fedorenko CLA 2011-08-01 10:37:46 EDT
What kind of proxy does your company use? Is it NTLM by any chance?
Comment 2 Markus Liebelt CLA 2011-08-01 11:02:05 EDT
(In reply to comment #1)
> What kind of proxy does your company use? Is it NTLM by any chance?

How can I check what kind of proxy I have? What I have is a list of possible proxy servers, and each one I use works the same way. As I read about NTLM, it is mostly about authentication in a non active directory environment. We don't have to authenticate for the proxy, it is sufficient to set host and port to use it.
Comment 3 Igor Fedorenko CLA 2011-08-01 11:08:26 EDT
Try this

1. install maven runtime 3.0.3 from m2e marketplace (preferences->maven->discovery)
2. make sure you have org.eclipse.m2e.logback.feature installed.
3. enable com.ning.http.client DEBUG log in .metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.*.xml
4. restart eclipse and reproduce the problem

After that, zip and attach here 

1. .metadata/.plugins/org.eclipse.m2e.logback.configuration/*.log. This will
likely contain slightly obfuscated username/password information as part of
http auth challenge/response, so you want to remove that. we don't need your
passwords, at least not yet ;-)
2. eclipse configuration details
(help->about_eclipse_sdk->installation_details->configuration)
Comment 4 Markus Liebelt CLA 2011-08-02 01:53:26 EDT
Created attachment 200685 [details]
Archive of log from timeout in update index with configuration of eclipse and logback feature

Added the attachment of following the advise above. Installed maven runtime 3.0.3, ensured logback feature, enabled DEBUG for com.ning.http.client and restarted eclipse. The resulting log file (0.log) does not contain more information to the previous log, there is no indication that a http auth challenge / response is going on. I have added as well the configuration of my eclipse installation (configuration.log) and the configuration of the logback feature.
Comment 5 Igor Fedorenko CLA 2011-08-02 02:08:04 EDT
Can I see <proxies/> element from your settings.xml file? (don't forget to obfuscate credentials and anything else sensitive you have there)
Comment 6 Markus Liebelt CLA 2011-08-02 02:21:51 EDT
(In reply to comment #5)
> Can I see <proxies/> element from your settings.xml file? (don't forget to
> obfuscate credentials and anything else sensitive you have there)

I do not have a settings.xml file. I started with a plain Indigo installation, and did not configure the Maven installation inside eclipse. My preferences dialog tells me that there does not exist a file c:\users\mliebelt\.m2\settings.xml

I have checked another Indigo installation where I have added Windows > Preferences > Maven > Installations my local installation of Maven 2.2 on my machine. The settings.xml of that installation includes the following section:

    <proxy>
      <id>tsi</id>
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host>www-3g.services.my-company.com</host>
      <port>80</port>
      <nonProxyHosts>my-company.com|my-mother.com</nonProxyHosts>
    </proxy>

There the index is built and the dependency resolution works as expected. Seems like that is the problem. I will recheck if referencing the Maven installation solves the problem.
Comment 7 Markus Liebelt CLA 2011-08-02 02:35:21 EDT
I have added to the Indigo installation that did not work with the dependency management the Maven installation, and enforced that the index of Maven Central is updated. It did not had to download the index anew, but used the existing one then.

I have then removed the information about the Maven installation, and created a new Maven project. In the POM, I could use dependency management and resolve artifacts that are not stored in my local repository.

I then restarted the IDE, and created afterwards a new project that referenced Hibernate (current version). The building stopped at 25%, and the error afterwards told:

ArtifactDescriptorException: Failed to read artifact descriptor for org.hibernate:hibernate:pom:3.5.4-Final: ArtifactResolutionException: Could not transfer artifact org.hibernate:hibernate:pom:3.5.4-Final

So to summarize it, even if the dependency resolution is done through Maven Central directly (with the embedded Maven installation 3.0.3), it is necessary to configure at least one Maven installation with a working proxy configuration.

The bug could be closed in my opinion (and it would be nice if some information about that could be available).
Comment 8 Igor Fedorenko CLA 2011-08-02 02:41:45 EDT
m2e tries to follow Maven command line build configuration as close as practically possible. In particular, all network access configuration (proxy, credentials, etc) are expected to come from either user or global settings.xml file.
Comment 9 Markus Liebelt CLA 2011-08-03 01:51:18 EDT
I did not find any hint that it is either necessary to configure a maven installation or necessary to configure user settings. If both are not configured, there could be a hint that the configuration of one of them would be necessary. And yes, without the need for a proxy, everything seems to work. So perhaps a chance to enhance the documentation or the error handling of m2e.
Comment 10 Denis Roy CLA 2021-04-19 13:26:45 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/