views:

529

answers:

4

I have Intellij IDEA Community installed on a Linux box that needs to use an authenticated proxy to get to the Internet. I have a system-wide proxy on the box that works, and I have the proxy configured in ~/.m2/settings.xml. Maven correctly uses the proxy when I run try it from the command-line.

I have the same proxy configured within Intellij and it gives me the plugins listing correctly. But when I try to sync with the Maven repository withing Intellij I keep getting this:

[WARNING] Unable to get resource 'org.codehaus.mojo:hibernate3-maven-plugin:pom:2.2' 
from  repository restlet (http://maven.restlet.org): Authorization failed: Not   
authorized by proxy.

I went to Settings->Maven and put in the proxy info as properties and that didn't work. I can see by looking at those settings that Intellij is reading my ~./m2/settings.xml fine because it knows where my local repo is (it's in a non-standard place).

Anyone know how I can get this working?

+1  A: 

Can you try either removing the proxy setting in settings.xml or the setting in IntelliJ itself.

And then try to sync with the maven repo from within Intellij.

jitter
That didn't work, but it let me to the right path. :)
MikeHoss
A: 

I commented out the proxy config in my ~/.m2/settings.xml file, let the Intellij Proxy info alone, and then supplied the properties in Setting->Maven. Not sure why that worked (nor why the settings.xml wasn't working right) but it's working now.

MikeHoss
And how is that different from what I suggested?
jitter
It's not -- I was just going to comment on it.Commenting out the proxy config in the settings.xml just disabled the proxy altogether. So I thought it was working but instead it was trying to connect, couldn't, and kept trying for a while. I figured this out after I left it run for two hours. A maven update shouldn't take that long!I didn't get the same error as above -- instead I got "Unable to connect to . . ". Which means that it didn't even get to the proxy.anyone else have any ideas?
MikeHoss
+1  A: 

Could you write me on email (Anton(dot)Makeev(at)jetbrains(dot)com) and sent the settings.xml file, I'll check it.

Thanks, Anton Makeev

Anton Makeev
I forgot to say -- Sent!
MikeHoss
A: 

I Have found similar issues with the Maven 2.2 integration in intellij 9. I am using 9.0.1

I use intellij behind a corporate firewall/proxy. If I point Intellij's maven conf to use external Maven and maven conf that has the proxy settings inside, intellij fails to download artifacts from any remote repositories.

Had no problems with intellij-8, this only started after the upgrade. The Maven conf has not changed either.

I have to do a Maven build from command line to get any new dependent artifacts into my local repo then use intellij-9.

The Maven 2.2 integration has issues behind proxy servers.

Paul W
I got it to mostly work -- I think the secret it to tell Intellij your config instead of trying to figure it out.Goto File->Settings-Maven and set all three Maven directories at the bottom. That got it working for me.
MikeHoss