Results 1 to 2 of 2
  1. #1
    zdenek.zikan is offline Member
    Join Date
    Jan 2010
    Posts
    2
    Rep Power
    0

    Default Setting up proxy for Maven mojo doesn't work

    Hello world,

    I want to use proxy in my maven project (to make some builds faster, because when processing Docbook documentation, some DTDs are slow to fetch from some servers).
    I have tried following ways how to do it:

    1) set it up in Java:
    $JAVA_HOME/bin/ControlPanel -> Network Settings

    2) in ~/.m2/settings.xml in properties
    Java Code:
    <settings>
    	...
    	<proxies>
    		<proxy>
    			<active>true</active>
    			<protocol>http</protocol>
    			<host>proxy.mydomain.com</host>
    			<port>3128</port>
    			<nonProxyHosts>*.mydomain.com</nonProxyHosts>
    		</proxy>
    	</proxies>
    </settings>
    3) in ~/.m2/settings.xml in a profile, that is activated by default in my projects
    Java Code:
    <profile>
    	...
    	<properties>
    		...
    		<http.proxyHost>proxy.myhost.com</http.proxyHost>
    		<http.proxyPort>3128</http.proxyPort>
    	</properties>
    </profile>
    4) in the pom.xml's properties
    Java Code:
    <properties>
    	...
    	<http.proxyHost>proxy.myhost.com</http.proxyHost>
    	<http.proxyPort>3128</http.proxyPort>
    </properties>
    5) environment variable http_proxy:
    Java Code:
    export http_proxy="http:--proxy.myhost.com:3128/"
    (I'm using Linux, it works for other command line utilities; I replaced // by -- in the URL to circumvent URL posting restriction of this forum).

    6) on the command line:
    Java Code:
    mvn some_profiles_and_goals -Dhttp.proxyHost=proxy.myhost.com
    -Dhttp.proxyPort=3128
    I have tried it with Maven 2.0.10 and 2.2.1 with the same result. Only the solution 6 works, but that's not what I want to use (I don't want to specify parameters every time I run maven).


    Thanks,
    Zdenek

  2. #2
    zdenek.zikan is offline Member
    Join Date
    Jan 2010
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Using Maven
    By tascoa in forum New To Java
    Replies: 0
    Last Post: 08-21-2009, 04:45 PM
  2. Replies: 0
    Last Post: 04-20-2009, 07:26 PM
  3. Http - proxy or non-proxy ?
    By Shiv in forum Networking
    Replies: 0
    Last Post: 04-11-2009, 09:07 AM
  4. Maven
    By Java Tutorial in forum Java Tutorial
    Replies: 0
    Last Post: 06-02-2008, 01:58 PM
  5. Maven or ANT
    By goldhouse in forum Reviews / Advertising
    Replies: 0
    Last Post: 08-09-2007, 09:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •