M2eclipse does not load maven artifacts

I recently installed eclipse 3.6.1 and the m2eclipse plugin for use with my existing maven assembly, but I ran into a lot of problems trying to get it working.

My existing maven project builds fine from the command line.

After importing my project tree into eclipse, I started the build in one of the projects. In the end, he died with this error:

10/18/10 2:03:02 PM PDT: [DEBUG] Failed to get org.apache.maven.wagon resource: wagon file: jar: 1.0-alpha-6 'from the central repository ( http: //repo1.maven .org / maven2 ) Authorization error: transmission failure: Proxy not allowed

Maven from the command line can download material from the center without any problems.
Eclipse was able to download the m2eclispe plugin from the sonata site.
- therefore, based on this, I know that my proxy settings work.

But for some reason, eclipse or m2eclipse cannot tell maven the correct settings.

I checked the message here and tried to delete the * .lastupdated files, but this did not affect the errors.

How to fix it?

+7
maven m2eclipse
source share
4 answers

Eclipse does not know the proxy information that is configured on your operating system. Proxy information arrives at boot time of your system, possibly from a boot server or manually configured on your system. I use linux mainly and cannot explain how this information is read by a Windows machine of any taste.

Maven knows proxy information from the command line. Maven from the command line may have a shell runtime available to read proxy information. I think Eclipse ignores the shell runtime.

I hit this problem and solved it as follows. To continue, you need to know your proxy IP address and proxy authentication data, such as username / password. The network administrator or proxy must have this available to you. I swallowed the wire using the wiring.

By the way, the eclise "Install New Software" and "Check for Updates" probably doesn't work either. They will be after that.

Also, after you do this, you will want to manually delete the "lastUpdated" files from your local m2 storage. I cannot find much information on how these files are used, but they will interfere when you expect to download an artifact.

Open the network connection settings as follows: Windows-> Settings-> General-> Network Connections

Install the Active Provider in the Guide.

Click the check button for HTTP and HTTPS (possibly SOCKS).

Select the HTTP line and click "Edit."

Enter the host IP address, click "Authentication Required", enter the username and password. If your proxy is managed by a Windows domain, the username will look like this: DOMAIN \ USERNAME.

Repeat for HTTPS.

Click OK, OK, OK.

Go to the city.

+2
source share

In the same eclipse m2 problem, there was a problem with the proxy server.

I had the correct proxy settings in settings / shared / network connections. But it did not help.

However, after I set my proxy user / password in "settings.xml", then everything worked sofar.

It seems that the proxy settings in the settings did not affect my case.

+1
source share

I had the same symptoms ("Install New Software" worked fine, Maven from the command line worked fine). I don’t think my proxy server requires authentication - the Native provider on the Network Connections page Eclipse says Auth = false , and my settings.xml contains empty username and password elements in the proxy configuration.

In any case, I tried to remove the username and password elements from my settings.xml proxy configuration and delete the *.lastUpdated files, and now m2eclipse seems completely happy.

My theory is that if you specify empty elements, then authentication information will not be sent to the Maven command line (2.2.1 in my case), so it works with my proxy server, whereas, possibly, Maven 3, built in m2eclipse sends auth headers, but with empty information that is rejected by my proxy. I didn’t sniff traffic to confirm this, so this is just a hunch. Even if this is correct, I’m not sure who is to blame.

+1
source share

I had the same problem with m2eclipse. After my project was created using the eclipse command line (using the compilation target), I could also use m2eclipse to build it for the same purpose (using Run As> Maven Build ...>). However, by default Run As> Maven Install still failed to execute "Error Code 407, Proxy Authentication Required", which is strange because the configured proxy does not require authentication. And although this error is somewhat different, the description of the problem is rather simulative.

Now that I used the Maven command line to install, the standard m2eclipse build was also successful. I have not changed any configurations. Moreover: as soon as I ran it at a time, m2eclipse had no additional dependencies ?!

So, to conclude: in my opinion, there is some flaw in m2eclipse, which makes it behave differently when communicating with proxies during initial dependency loading.

I hope this workaround works for you too ...

+1
source share

All Articles