views:

44

answers:

2

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

My existing maven project builds fine from the commandline.

After importing my project tree into eclipse, I ran a build on one of the projects. It eventually died with this error:

10/18/10 2:03:02 PM PDT: [DEBUG] Unable to get resource 'org.apache.maven.wagon:wagon-file:jar:1.0-alpha-6' from repository central (http://repo1.maven.org/maven2) Authorization failed: Transfer failed: Not authorized by proxy

Maven from the command line can download stuff from central without a problem.
Eclipse was able to download the m2eclispe plugin from the sonatype site.
-- so based on this, I know my proxy settings are working.

But for some reason eclipse or m2eclipse is unable to tell maven the right settings.

I checked the post here and tried deleting the *.lastupdated files, but that had no effect on the errors.

How do I fix this?

A: 

Eclipse does not know the proxy information that is configured into your Operating System. The proxy information comes during boot of your system perhaps from a boot server, or is manually configured into your system. I use linux mostly and cannot explain how this information is read by a windows machine of any flavor.

Maven from the command line DOES know the proxy information. Maven from the command line perhaps has shell runtime environment available to be able to read proxy information. I guess Eclipse ignores this shell runtime environment.

I hit this problem and resolved it as follows. To proceed, you need to know your proxy ip address, and your proxy authentication information like username/password. Your network or proxy administrator should have this available for you. I snooped the wire using wireshark.

By the way, eclise's "Install New Software" and "Check For Updates" probably don't work either. They will after this.

Also, after you complete this, you will want to manually remove the 'lastUpdated' files from your local m2 repository. I can't find much info w/ google on how these files are used, but they will get in the way when you expect to download an artifact.

Open the network connections preferences this way: Windows->Preferences->General->NetworkConnections

Set Active Provider to Manual.

Click check-button for HTTP and HTTPS (maybe SOCKS).

Select HTTP line and click Edit.

Provide host ip address, click 'Requires Authentication', enter user name and password. If your proxy is managed by a windows domain, username would look like: DOMAIN\USERNAME.

Repeat for HTTPS.

Click OK, OK, OK.

Go to town.

john franey
as stated in my origional post: `install new software does work` -- otherwise I would not have been able to install the m2eclipse plugin. but I changed the proxy host name to an IP address for both http and https - error is the same. Any other ideas?
Jon