Results 1 to 7 of 7
  1. #1
    setevoy's Avatar
    setevoy is offline Member
    Join Date
    Aug 2013
    Location
    Kiev, UA
    Posts
    12
    Rep Power
    0

    Default Maven: use different proxy

    Hello.

    Here is a question... I have Maven and project to build... But for connect to repositories - Maven use few proxyies which discribed in settings.xml as:

    Java Code:
         <proxy>
          <id>main</id>
          <active>true</active>
          <protocol>http</protocol>
          <username>user</username>
          <password>pass</password>
          <host>host</host>
          <port>8080</port>
          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
        </proxy>
         <!--  <proxy>
          <id>name</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>host</host>
          <port>port</port>
          <nonProxyHosts>something</nonProxyHosts>
        </proxy> -->
        <!-- <proxy>
          <id>default</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>proxy</host>
          <port>port</port>
        </proxy> -->
    So. Now when I'm build project - I need to comment/uncommet one-by-one this list of proxy and restart install every time.

    Is there any way to set something like "priority" for Maven to it sort out availible destination over different proxy?

    Thanks for tips.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,914
    Rep Power
    5

    Default Re: Maven: use different proxy

    I don't understand your problem. Why do you need to comment/uncomment proxies during a build?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    setevoy's Avatar
    setevoy is offline Member
    Join Date
    Aug 2013
    Location
    Kiev, UA
    Posts
    12
    Rep Power
    0

    Default Re: Maven: use different proxy

    As I heard - Maven can't use few proxies at the same time and it must have only one in config... No?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,914
    Rep Power
    5

    Default Re: Maven: use different proxy

    Then why do you have multiple proxies in the file?

    You can have multiple proxies - for different protocols (http, https). The existence of the 'proxies' parent XML node already tells you that you can have multiple, otherwise it wouldn't be plural. A simple Google provided more proof; I don't rely on what I hear.
    Last edited by gimbal2; 09-05-2013 at 10:12 AM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    setevoy's Avatar
    setevoy is offline Member
    Join Date
    Aug 2013
    Location
    Kiev, UA
    Posts
    12
    Rep Power
    0

    Default Re: Maven: use different proxy

    Quote Originally Posted by gimbal2 View Post
    Then why do you have multiple proxies in the file?
    To get access to different repos from our network... I mean - we have our own repo and access to it via one proxy... Access to repo1.maven.org - via another proxy... But all of them only for HTTP traffic.

    You can have multiple proxies - for different protocols (http, https). The existence of the 'proxies' parent XML node already tells you that you can have multiple, otherwise it wouldn't be plural.
    Really... I don't thougt about it... Thanks for help :-) I'm really newbie with Maven&Java so sorry for so questions...

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,914
    Rep Power
    5

    Default Re: Maven: use different proxy

    Get a good book on Maven dude. Its a complicated tool to use, better get a nice bundle of information in which you can look up all your howto questions.

    your own proxy, is that by any chance a Nexus? Because you can set it up to mirror maven central (and possibly the JBoss repository which also holds important dependencies) so you don't ever need to go to the internet from your client machines. If it isn't, it might be worth it for you to actually setup a nexus but that is even more advanced material.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    setevoy's Avatar
    setevoy is offline Member
    Join Date
    Aug 2013
    Location
    Kiev, UA
    Posts
    12
    Rep Power
    0

    Default Re: Maven: use different proxy

    Quote Originally Posted by gimbal2 View Post
    Get a good book on Maven dude.
    Well, I'm reading now Maven by Example. But some question need to be solved right now. It's a problem, I know :-)

    your own proxy, is that by any chance a Nexus?
    I will. I thought about it and it really can be helpfull for me and our developers. Because now we use non-local Nexus in other network via proxy. I don't sure yet - but may be there will be opportunity to synchronize both of them. Will see. Thanks for idea :-)

Similar Threads

  1. Replies: 0
    Last Post: 12-17-2012, 01:32 PM
  2. openConnection(Proxy proxy) question
    By Dark in forum New To Java
    Replies: 8
    Last Post: 12-31-2011, 01:15 PM
  3. Setting up proxy for Maven mojo doesn't work
    By zdenek.zikan in forum Advanced Java
    Replies: 1
    Last Post: 01-12-2010, 12:14 PM
  4. Replies: 0
    Last Post: 04-20-2009, 06:26 PM
  5. Http - proxy or non-proxy ?
    By Shiv in forum Networking
    Replies: 0
    Last Post: 04-11-2009, 08:07 AM

Posting Permissions

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