常春藤代理服务器设置 [英] Proxy settings with ivy

查看:240
本文介绍了常春藤代理服务器设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里我在的ivy.xml在我们公司内部的svn定义依赖关系的问题。我能够在没有任何蚂蚁代理任务,访问此网站SVN。虽然我的依赖驻留在ibiblio上,这是外界我们的企业的东西,并且需要代理序下载的东西。我在这里使用的常春藤面临的问题。

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 dependencies resides on ibiblio, that’s something outside our corporate, and needs proxy inorder to download something. I am facing problem using ivy here.

我在build.xml中有以下

I have following in build.xml

<target name="proxy">  
    <property name="proxy.host" value="xyz.proxy.net"/>  
    <property name="proxy.port" value="8443"/>  
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>  
</target>  

<!-- resolve the dependencies of stratus -->
<target name="resolveTestDependency" depends="testResolve, proxy" description="retrieve test dependencies with ivy">
    <ivy:settings file="stratus-ivysettings.xml" />
    <ivy:retrieve conf="test" pattern="${jars}/[artifact]-[revision].[ext]"/><!--pattern here specifies where do you want to download lib to?-->                                          
</target>

<target name=" testResolve ">
    <ivy:settings file="stratus-ivysettings.xml" />
    <ivy:resolve conf="test" file="stratus-ivy.xml"/>
</target>

以下是层云,ivysettings.xml摘录

Following is the excerpt from stratus-ivysettings.xml

<resolvers>  
    <!-- here you define your file in private machine not on the repo (e.g. jPricer.jar or edgApi.jar)-->  
    <!-- This we will use a url nd not local file system.. -->  
    <url name="privateFS">  
        <ivy pattern="http://xyz.svn.com/ivyRepository/ [organisation]/ivy/ivy.xml"/>                                                    
    </url>  
.  
.  
.  
    <url name="public" m2compatible="true">     
        <artifact pattern="http://www.ibiblio.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>  
    </url>
.  
.  
.  

因此​​,作为可以在这里获取的ivy.xml看到的,我不需要任何代理,当我设置代理自己的网络内的哪些是不能访问。但在另一方面,我使用ibiblio上,以及它是外部到我们的网络,并只与代理工作。所以上面的build.xml不会在这种情况下工作。谁能帮助这里。

So as can be seen here for getting ivy.xml, I don’t need any proxy as its within our own network which cant be accesses when I set proxy. But on the other hand I am using ibiblio as well which is external to our network and works only with proxy. So above build.xml wont work in that case. Can somebody help here.

我不需要代理的同时获得的ivy.xml(好像我有代理,常春藤将无法找到网络中的代理背后ivy文件),当我的解析器去公共网址我只需要它。

I don’t need proxy while getting ivy.xml (as if I have proxy, ivy wont be able to find ivy file behind proxy from within the network), and I just need it when my resolver goes to public url.

推荐答案

在使用 setproxy ,使用 nonproxyhosts 属性来指定该代理不应该被用于主机(管隔开)。例如,修改 setproxy 任务在你的例子

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"/>

有关详细信息,请参阅<一个href=\"http://ant.apache.org/manual/Tasks/setproxy.html\">http://ant.apache.org/manual/Tasks/setproxy.html

这篇关于常春藤代理服务器设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆