Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
188 views
Welcome To Ask or Share your Answers For Others

1 Answer

  1. Navigate to Maven > Importing1. inside the IntelliJ IDEA Settings (which is found under File > Settings).

  2. The second last option in Maven > Importing is a field named "VM options for importer". Append the following to whatever already exists there:

    -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128

    Here, replace myproxy.com with your proxy server, (e.g. http://myproxyserver.com). Replace 3128 with your proxy port (e.g. 8080).

  3. Do the same under Maven > Runner1

  4. Apply and close the settings window.

It should work now.


1 This may be nested under Build, Execution, Deployment > Build Tools >, depending on the version of IntelliJ you're using.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...