Intellij Community can't use http proxy for Maven

Viewed 82121

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?

9 Answers

A little update for memo. I don't have a standalone maven installed, so finally I fixed this by modifying the maven plugin settings. settings.xml is located at :

IntelliJ IDEA Community Edition 2017.3.4\plugins\maven\lib\maven3\conf\settings.xml

You can find proxy settings and change it as mentioned above.

I meet the same problem.By ShadowsocksR,I can visit some websites that i can't visit without ShadowsocksR. I use Intellij , the error is "Connection timed out: connect -> [Help 1]".At last, I also added my proxy config as:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
   <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>localhost</host>
      <port>1080</port>
      <username>***.***.**.***:****</username>
      <password>*******</password>
      <nonProxyHosts>www.baidu.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

My computer environment is win10. http://maven.apache.org/guides/mini/guide-proxies.html

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.

I just add it in the VM option in the run configuration, and it works

-DproxySet=true -DproxyHost=proxy.com -DproxyPort=3132

inside the IntelliJ IDEA -> edit configuration ->click on modify option -> Add VM options and add it, replace "proxy.com" with your proxy server (e.g. http://myproxyserver.com)

Related