Proxy settings with ivy

后端 未结 2 1026
夕颜
夕颜 2020-12-05 08:18

I have an issue where in I have defined dependancies in ivy.xml on our internal corporate svn. I am able to access this svn site without any proxy task in ant. While my depe

相关标签:
2条回答
  • 2020-12-05 08:50

    When using setproxy, use the nonproxyhosts attribute to specify the hosts that the proxy should not be used for (pipe separated). e.g, modify the setproxy task in your example to

    <setproxy proxyhost="${proxy.host}"
              proxyport="${proxy.port}"
              nonproxyhosts="xyz.svn.com"/>
    

    For more details see http://ant.apache.org/manual/Tasks/setproxy.html

    0 讨论(0)
  • 2020-12-05 08:55

    ANT proxy settings

    Far as I know, proxy settings cannot be set within the ANT file. The documentation states that you need to set the following environment variable

    export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
    

    These are system properties (as opposed to a normal ANT property).

    Update: I stand corrected. I see you're using the setproxy method of setting the proxy. I've never used it. Setting the system parameters has always worked for me and had the advantage of being outside of the build file (for example when I'm working from home with no proxies).

    To configure "no proxy" options

    I don't know how to exclude local hosts using the ANT proxy mechanism. All I can suggest is trying to configure the JRE directly

    http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/proxie_config.html

    Maven resolver

    For maven central dependencies you need a resolver that looks like this

    <ibiblio name="maven2" m2compatible="true"/>
    

    This will automatically go to the Maven central URL "http://repo1.maven.org/maven2". According to the doco this resolver will use the module POMs in Maven to determine transient dependencies.

    Finally a word of warning. Unless you're using a modules section in your ivysettings file, make sure that your resolvers are declared within a chain resolver so that ivy will search both repositories for each module

    <chain name="defaultResolver" returnFirst="true">
        <url name="privateFS">
            <ivy pattern="http://xyz.svn.com/ivyRepository/ [organisation]/ivy/ivy.xml"/>
        </url>
        <ibiblio name="maven2" m2compatible="true"/>
    </chain>
    
    0 讨论(0)
提交回复
热议问题