2011-12-12 11 views
6

मैं प्रॉक्सी सर्वर के पीछे काम करने के लिए एएनटी और आईवीवाई प्राप्त करने की कोशिश कर रहा हूं।चींटी प्रॉक्सी विंडोज पर्यावरण चर कैसे

SetProxy काम से काम करता है ठीक

<target name="proxy"> 
    <property name="proxy.host" value="proxy.server.com" /> 
    <property name="proxy.port" value="8080" /> 
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" /> 
</target> 

लेकिन जब मैं पर्यावरण चर

का उपयोग करने की कोशिश की
set ANT_OPTS="-Dhttp.proxyHost=proxy.server.com -Dhttp.proxyPort=8080" 

आइवी रेपोस कनेक्ट नहीं कर सकता और यहाँ प्रॉक्सी के लिए चींटी गुण उत्पादन होता है

[echoproperties] http.proxyHost=proxy.server.com -Dhttp.proxyPort\=8080 

जब मैंने "autoproxy" तर्क का कोई फायदा नहीं लिया

ant -autoproxy deploy 

यहाँ चींटी

C:\Workspace\DevProjects\fxin>ant -Dproxy.host=proxy.eur.xerox.com -Dproxy.port=8000 deploy 
Buildfile: C:\Workspace\DevProjects\fxin\build.xml 

load-properties: 
    [echo] Using properties file: build.properties 

download-ivy: 
[echoproperties] #Ant properties 
[echoproperties] #Wed Dec 14 10:05:03 GMT 2011 
[echoproperties] ant.core.lib=C\:\\Tools\\apache-ant-1.8.2\\lib\\ant.jar 
[echoproperties] ant.file=C\:\\Workspace\\DevProjects\\fxin\\build.xml 
[echoproperties] ant.file.fxin=C\:\\Workspace\\DevProjects\\fxin\\build.xml 
[echoproperties] ant.file.type=file 
[echoproperties] ant.file.type.fxin=file 
[echoproperties] ant.home=C\:\\Tools\\apache-ant-1.8.2 
[echoproperties] ant.java.version=1.7 
[echoproperties] ant.library.dir=C\:\\Tools\\apache-ant-1.8.2\\lib 
[echoproperties] ant.project.default-target=usage 
[echoproperties] ant.project.invoked-targets=deploy 
[echoproperties] ant.project.name=fxin 
[echoproperties] ant.version=Apache Ant(TM) version 1.8.2 compiled on December 20 2010 
[echoproperties] app.copyright=2011-2012 
[echoproperties] app.name=fxin 
[echoproperties] app.vendor=MyUser 
[echoproperties] app.version=0.1 
[echoproperties] appserver.home=C\:\\Users\\MyUser/bin/apache-tomcat-7.0.22 
[echoproperties] appserver.lib=C\:\\Users\\MyUser/bin/apache-tomcat-7.0.22/lib 
[echoproperties] awt.toolkit=sun.awt.windows.WToolkit 
[echoproperties] basedir=C\:\\Workspace\\DevProjects\\fxin 
[echoproperties] build.dir=war/WEB-INF/classes 
[echoproperties] build.properties=build.properties 
[echoproperties] db.driver=com.mysql.jdbc.Driver 
[echoproperties] db.pw=demo 
[echoproperties] db.url=jdbc\:mysql\://localhost\:3306/demo 
[echoproperties] db.user=demo 
[echoproperties] deploy.path=C\:\\Users\\MyUser/bin/apache-tomcat-7.0.22/webapps 
[echoproperties] file.encoding=Cp1252 
[echoproperties] file.encoding.pkg=sun.io 
[echoproperties] file.separator=\\ 
[echoproperties] ivy.install.version=2.2.0-rc1 
[echoproperties] ivy.jar.file=C\:\\Workspace\\DevProjects\\fxin\\lib\\tools\\ivy-2.2.0-rc1.jar 
[echoproperties] ivy.retrieve.pattern=C\:\\Workspace\\DevProjects\\fxin\\lib/[conf]/[organisation]/[artifact]-[revision].[ext] 
[echoproperties] ivy.settings.file=${res.ivy.dir}/ivysettings.xml 
[echoproperties] java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment 
[echoproperties] java.awt.printerjob=sun.awt.windows.WPrinterJob 
[echoproperties] java.class.path=C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-launcher.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-antlr.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-bcel.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-bsf.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-log4j.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-oro.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-regexp.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-resolver.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-apache-xalan2.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-commons-logging.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-commons-net.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-jai.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-javamail.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-jdepend.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-jmf.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-jsch.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-junit.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-junit4.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-launcher.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-netrexx.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-swing.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant-testutil.jar;C\:\\Tools\\apache-ant-1.8.2\\lib\\ant.jar;C\:\\Program Files\\Java\\jdk1.7.0\\lib\\tools.jar 
[echoproperties] java.class.version=51.0 
[echoproperties] java.endorsed.dirs=C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\endorsed 
[echoproperties] java.ext.dirs=C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\ext;C\:\\Windows\\Sun\\Java\\lib\\ext 
[echoproperties] java.home=C\:\\Program Files\\Java\\jdk1.7.0\\jre 
[echoproperties] java.io.tmpdir=C\:\\TEMP\\ 
[echoproperties] java.library.path=C\:\\Program Files\\Java\\jdk1.7.0\\bin;C\:\\Windows\\Sun\\Java\\bin;C\:\\Windows\\system32;C\:\\Windows;C\:\\Program Files\\App\\App Feature Islands\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Oracle\\instantclient_10_2;C\:\\Program Files\\Common Files\\Roxio Shared\\DLLShared\\;C\:\\Program Files\\Common Files\\Roxio Shared\\10.0\\DLLShared\\;C\:\\Tools\\cygwin\\bin;C\:\\Tools\\bin;C\:\\Program Files\\7-Zip;C\:\\Program Files\\ImageMagick-6.7.0-Q16;C\:\\Program Files\\Java\\jdk1.7.0\\bin;C\:\\Tools\\apache-ant-1.8.2\\bin;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files\\MySQL\\MySQL Server 5.5\\bin;. 
[echoproperties] java.runtime.name=Java(TM) SE Runtime Environment 
[echoproperties] java.runtime.version=1.7.0-b147 
[echoproperties] java.specification.name=Java Platform API Specification 
[echoproperties] java.specification.vendor=Oracle Corporation 
[echoproperties] java.specification.version=1.7 
[echoproperties] java.vendor=Oracle Corporation 
[echoproperties] java.vendor.url=http\://java.oracle.com/ 
[echoproperties] java.vendor.url.bug=http\://bugreport.sun.com/bugreport/ 
[echoproperties] java.version=1.7.0 
[echoproperties] java.vm.info=mixed mode, sharing 
[echoproperties] java.vm.name=Java HotSpot(TM) Client VM 
[echoproperties] java.vm.specification.name=Java Virtual Machine Specification 
[echoproperties] java.vm.specification.vendor=Oracle Corporation 
[echoproperties] java.vm.specification.version=1.7 
[echoproperties] java.vm.vendor=Oracle Corporation 
[echoproperties] java.vm.version=21.0-b17 
[echoproperties] lib.build.dir=C\:\\Workspace\\DevProjects\\fxin\\lib\\compile 
[echoproperties] lib.dir=C\:\\Workspace\\DevProjects\\fxin\\lib 
[echoproperties] lib.runtime.dir=C\:\\Workspace\\DevProjects\\fxin\\lib\\runtime 
[echoproperties] lib.test.dir=C\:\\Workspace\\DevProjects\\fxin\\lib\\test 
[echoproperties] lib.tools.dir=C\:\\Workspace\\DevProjects\\fxin\\lib\\tools 
[echoproperties] line.separator=\r\n 
[echoproperties] os.arch=x86 
[echoproperties] os.name=Windows 7 
[echoproperties] os.version=6.1 
[echoproperties] path.separator=; 
[echoproperties] proxy.host=proxy.server.com 
[echoproperties] proxy.port=8000 
[echoproperties] report.dir=C\:\\Workspace\\DevProjects\\fxin\\report 
[echoproperties] report.ivy.dir=C\:\\Workspace\\DevProjects\\fxin\\report\\ivy 
[echoproperties] report.javac.dir=C\:\\Workspace\\DevProjects\\fxin\\report\\javac 
[echoproperties] res.dir=res 
[echoproperties] res.ivy.dir=C\:\\Workspace\\DevProjects\\fxin 
[echoproperties] source.encoding=UTF-8 
[echoproperties] source.version=1.5 
[echoproperties] src.dir=src 
[echoproperties] sun.arch.data.model=32 
[echoproperties] sun.boot.class.path=C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\resources.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\rt.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\sunrsasign.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\jsse.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\jce.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\lib\\charsets.jar;C\:\\Program Files\\Java\\jdk1.7.0\\jre\\classes 
[echoproperties] sun.boot.library.path=C\:\\Program Files\\Java\\jdk1.7.0\\jre\\bin 
[echoproperties] sun.cpu.endian=little 
[echoproperties] sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86 
[echoproperties] sun.desktop=windows 
[echoproperties] sun.io.unicode.encoding=UnicodeLittle 
[echoproperties] sun.java.command=org.apache.tools.ant.launch.Launcher -Dproxy.host proxy.server.com -Dproxy.port 8000 deploy 
[echoproperties] sun.java.launcher=SUN_STANDARD 
[echoproperties] sun.jnu.encoding=Cp1252 
[echoproperties] sun.management.compiler=HotSpot Client Compiler 
[echoproperties] sun.os.patch.level= 
[echoproperties] test.dir=test 
[echoproperties] tomcat.manager.password=s3cret 
[echoproperties] tomcat.manager.url=http\://localhost\:8080/manager 
[echoproperties] tomcat.manager.username=tomcat 
[echoproperties] user.country=US 
[echoproperties] user.country.format=GB 
[echoproperties] user.dir=C\:\\Workspace\\DevProjects\\fxin 
[echoproperties] user.home=C\:\\Users\\MyUser 
[echoproperties] user.language=en 
[echoproperties] user.name=MyUser 
[echoproperties] user.script= 
[echoproperties] user.timezone= 
[echoproperties] user.variant= 
[echoproperties] web.dir=war 
[echoproperties] web.lib=war/WEB-INF/lib 
    [echo] installing ivy... 
     [get] Getting: http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.2.0-rc1/ivy-2.2.0-rc1.jar 
     [get] To: C:\Workspace\DevProjects\fxin\lib\tools\ivy-2.2.0-rc1.jar 
     [get] Error getting http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.2.0-rc1/ivy-2.2.0-rc1.jar to C:\Workspace\DevProjects\fxin\lib\tools\ivy-2.2.0-rc1.jar 

किसी भी विचार से बाहर है?

उत्तर

10

प्रयास करें मैं अंत में पर्यावरण की स्थापना द्वारा काम करने के लिए मिल गया है। आसपास के डबल qoutes

set ANT_OPTS=-Dhttp.proxyHost=proxy.eur.xerox.com -Dhttp.proxyPort=8000 

दोहरे उद्धरण चिह्नों या कमांड काम नहीं किया पर निर्दिष्ट करने के साथ किसी कारण से बिना चर। प्रॉक्सी सेटिंग को उद्धरण के साथ पर्यावरणीय चर में होना था।

आगे जोड़ने के लिए;

http://ant.apache.org/manual/install.html#proxy

आदेश प्रॉक्सी सेटिंग निर्दिष्ट करने से काम नहीं होता है, के रूप में वे मानक चींटी गुण नहीं JVM विकल्पों

होगा के अनुसार

अपने समय के लिए धन्यवाद

+0

धन्यवाद पर पास करें। मुझे उपयोगकर्ता नाम और पासवर्ड भी प्रदान करना है, और सोचा कि यह कमांड लाइन से काम नहीं करेगा। लेकिन यह आसपास के डबल कोट्स था जो मुझे भी पकड़ा। सेट करें ANT_OPTS = -Dhttp.proxyHost = proxy.mywork.co.nz -Dhttp.proxyPort = 8080 -Dhttp.proxyUser = डोमेन \ myuser -Dhttp.proxyPassword = password123 – GregHNZ

+0

क्या आपने कमांड लाइन पर अपना सेट कमांड चलाया था, या आपने किया इसे अपने ivysettings.xml में रखें? –

+0

धन्यवाद, आसपास के उद्धरण मुझे पकड़ लिया। दस्तावेज उद्धरण के साथ दिखाता है, यही कारण है कि हम सब पकड़े गए। – dleerob

1

आप गलत गुण सेट कर रहे हैं।

-Dproxy.host=proxy.server.com -Dproxy.port=8080 
+0

मुझे लगता है कि रूप में अच्छी तरह, लेकिन अभी भी कोशिश की थी काम नहीं करता Echoproperties सूची proxy.host प्रॉपर्टी शो में दिखाती है लेकिन प्रॉक्सी.पोर्ट दिखाया गया है कि यह जावा के तर्क से बचने के बराबर है। – rojanu

+0

@rojanu। कृपया अपना '' कमांड पोस्ट करें। साथ ही, कोई भी सेट ANT_OPTS सेट न करें, लेकिन इन गुणों को 'ant' कमांड लाइन –

संबंधित मुद्दे